‎2019 Feb 02 1:44 PM
Hi All,
Please help me to understand how to assign values to multiple fields using READ inside FOR , eg. for P_NAME1, PCITY1,PSTREET.... it is from same LT_ADRCP table am trying to read ADDRNUMBER and populate those 5 fields, but here if I use the below syntax, the Read statement is used 5 times which is not a good practice, with one read statement can I fill all 5 fields once?
et_entityset = VALUE lxt_entity( FOR lw_order IN lt_ekkn (
aufnr = lw_order-aufnr
ktext = lw_order-ktext
parnr = lw_order-parnr
aenam = lw_order-aenam
gstrp = lw_order-gstrp
gltrp = lw_order-gltrp
p_name1 = lt_adrcp[ addrnumber = lw_order-adrnr ]-p_name1
p_city1 = lt_adrcp[ addrnumber = lw_order-adrnr ]-p_city1
* p_street = 'STREETP1'.
* p_po_box_reg = 'STATEP1'.
* p_post_code1 = '10011'.
matnr = lw_order-matnr
maktx = lw_order-maktx
bdmng = lw_order-bdmng
meins = lw_order-meins
verpr = lw_order-verpr
waers = lw_order-waers
bdter = lw_order-bdter
ebeln = lw_order-ebeln
ebelp = lw_order-ebelp
) ).
Thanks in advance.
‎2019 Feb 02 2:19 PM
Have you tried using LET and VALUE combination, here is a ref https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abaplet.htm
‎2019 Feb 02 2:19 PM
Have you tried using LET and VALUE combination, here is a ref https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abaplet.htm
‎2019 Feb 02 2:36 PM
s1252 please convert it into an answer, I guess it's a good answer, don't you?
‎2019 Feb 02 4:34 PM
Hi Krishna, Thank you...I tried with LET and BASE too, but getting the syntax error if I use with the FOR .....it is allowing me to use only any one of those..may be am missing the proper syntax...let me try still more with it...
‎2019 Feb 02 7:22 PM
et_entityset = VALUE lxt_entity(
FOR lw_order IN lt_ekkn
LET <adrcp> = lt_adrcp[ addrnumber = lw_order-adrnr ]
IN (
aufnr = lw_order-aufnr
...
p_name1 = <adrcp>-p_name1
...
‎2019 Feb 03 8:43 AM
Hi Sandra,
Thanks for example.
Hi Krishna,
Thank you...
Thank you both for the answer......