on 09-27-2023 1:15 PM
Hi,
I am simply adding new rows to a table of type string, code below:
et_aud = VALUE #(
( data = 'No of Successful Records: ' && |{ iv_suc }| )
( data = 'No of Failed Records : ' && |{ iv_err }| )
( data = '' )
( data = COND #( WHEN it_suc IS NOT INITIAL THEN '***************************************************SUCCESS RECORDS****************************************************************' ) )
( data = COND #( WHEN it_suc IS NOT INITIAL THEN '' ) )
( LINES OF it_suc )
( data = COND #( WHEN it_suc IS NOT INITIAL THEN '' ) )
( data = COND #( WHEN it_err IS NOT INITIAL THEN '****************************************************ERROR RECORDS*****************************************************************' ) )
( data = COND #( WHEN it_suc IS NOT INITIAL THEN '' ) )
( LINES OF it_err )
).
for cases when IT_SUC IS INITIAL, it adds empty rows(see image) and its not required.
I cannot use Delete ITAB where rows are empty because I would need empty lines which I have added myself.
Any suggestion would be helpful.Combine LINES OF and COND or SWITCH to choose between 0 and any number of lines:
et_aud = VALUE #(
( data = 'No of Successful Records: ' && |{ iv_suc }| )
( data = 'No of Failed Records : ' && |{ iv_err }| )
( data = '' )
( LINES OF COND #( WHEN it_suc IS NOT INITIAL THEN VALUE #(
( data = '***************************************************SUCCESS RECORDS****************************************************************' ) )
( data = '' ) ) ) )
( LINES OF it_suc )
...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It worked as expected!!
didn't know the 'LINES OF' statement does this.
Thank You Sandra, new learning for me.
User | Count |
---|---|
77 | |
9 | |
9 | |
7 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.