03-20-2019 1:44 PM
I am have a interntable itab with Fields as F1,F2,F4,F4,F5.
Requirement is user will maintain one of those fields in TVARVC Example F2 , F4 he will maintain in TVARVC.
We need to capture the fields in the report and validate if they are initial or not then dont process them to the output if they are initial.
as of now. I am doing like.
Loop at itab into wa.
check wa-f2 is not intial and wa-f4 is not initial. ( If I have f2 ,f4 in dynamic table , they can be any fields or all fields)
How to keep this condition?
move wa to jtab.
append Jtab.
endloop.
Thanks in advance.
03-20-2019 2:40 PM
Check fields in TVARVC fields one by one.
For each you can use dynamic "ASSIGN component OF STRUCTURE wa", where component is name of field (i.e. 'F2' value in TVARVC etc.). Explore ABAP documentation link for more info.
03-20-2019 2:40 PM
Check fields in TVARVC fields one by one.
For each you can use dynamic "ASSIGN component OF STRUCTURE wa", where component is name of field (i.e. 'F2' value in TVARVC etc.). Explore ABAP documentation link for more info.
03-20-2019 3:05 PM
03-20-2019 3:12 PM
saslove.sap ?
ASSIGN 'F2' OF STRUCTURE wa TO FIELD-SYMBOL(<field>).
03-20-2019 6:23 PM
Thanks Tom.
What is wa and <field> types here, sorry just came back from meeting. TIA.
03-20-2019 8:43 PM
This is giving syntax error, please respond, thanks. error' OF STRUCTURE WA is not expected
ASSIGN'F2'OFSTRUCTURE wa TO FIELD-SYMBOL(<field>).
03-20-2019 8:49 PM
The correct syntax is Thanks for the direction
ASSIGN commponent 'F2' OF STRUCTURE wa TO FIELD-SYMBOL(<field>).
03-21-2019 4:09 PM
Tom, can you correct the below code ? whats wrong over there?
In Lwa_mapping I have column names Pernr, CC, DIV.
for pernr I am getting the <FIELD> symbol created, but later for next column, I am unable to, can you let me know the reason?
Like for next column it is CC but <FIELD> is initial and unable to get the data.
SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L0S52 { color: #0000FF; } .L0S55 { color: #800080; } .L0S70 { color: #808080; }
LOOP AT lt_mapping INTO lwa_mapping.
ASSIGN COMPONENT lwa_mapping-inputa OF STRUCTURE lwa_ftab TO FIELD-SYMBOL(<field>).
IF <field> IS ASSIGNED.
IF <field> IS INITIAL.
APPEND lwa_ftab TO lt_key_miss.
CLEAR lwa_ftab.
UNASSIGN <field>.
REJECT.
ELSE.
UNASSIGN <field>.
ENDIF.
ENDIF.
ENDLOOP.
03-21-2019 6:14 PM
Solved by self !! Column name have spaces so unable to do anything.
03-20-2019 5:18 PM
Please use the COMMENT button. ANSWER is only to propose a solution. You also have an option to convert your answer into a comment. Or even delete it.
03-20-2019 6:24 PM
Hi Sandra, when I click edit I dont see converting of answer to Comment, kindly advise, after clicking edit whats next ?
03-21-2019 1:32 PM