Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV :: Reading data from Work Area

Former Member
0 Likes
624

I want 2 fetch mwskz and orto1, name1 and store them in wa_final of my final internal table int_final.

i am not getting as how 2 proceed...Plz Help.

LOOP AT int_j_1iexcdtl INTO wa_j_1iexcdtl.

MOVE wa_j_1iexcdtl-rdoc1 TO wa_itab2-ebeln.

MOVE wa_j_1iexcdtl-ritem1 TO wa_itab2-ebelp.

ENDLOOP.

IF int_j_1iexcdtl[] IS NOT INITIAL.

SELECT ebeln

ebelp

matnr

bukrs

mwskz

FROM ekpo INTO TABLE int_ekpo

FOR ALL ENTRIES IN itab2 WHERE ebeln EQ itab2-ebeln

AND ebelp EQ itab2-ebelp.

IF int_ekko[] IS NOT INITIAL.

SELECT ort01 name1 lifnr

FROM lfa1 INTO TABLE int_lfa1

FOR ALL ENTRIES IN int_ekko WHERE lifnr EQ int_ekko-lifnr.

ENDIF.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
593

Hi Ajay ,

Press F1 on Append statement.

you forgot to append the records in below code :



LOOP AT int_j_1iexcdtl INTO wa_j_1iexcdtl.
MOVE wa_j_1iexcdtl-rdoc1 TO wa_itab2-ebeln.
MOVE wa_j_1iexcdtl-ritem1 TO wa_itab2-ebelp.
"Append should be in this place
ENDLOOP.

Hope this resolves your issue.

Edited by: Harsh Bhalla on Jan 21, 2010 5:06 PM

I want 2 fetch mwskz and orto1, name1 and store them in wa_final of my final internal table int_final.

i am not getting as how 2 proceed...Plz Help.

LOOP AT int_j_1iexcdtl INTO wa_j_1iexcdtl.

MOVE wa_j_1iexcdtl-rdoc1 TO wa_itab2-ebeln.

MOVE wa_j_1iexcdtl-ritem1 TO wa_itab2-ebelp.

ENDLOOP.

IF int_j_1iexcdtl[] IS NOT INITIAL.

SELECT ebeln

ebelp

matnr

bukrs

mwskz

FROM ekpo INTO TABLE int_ekpo

FOR ALL ENTRIES IN itab2 WHERE ebeln EQ itab2-ebeln

AND ebelp EQ itab2-ebelp.

IF int_ekko[] IS NOT INITIAL.

SELECT ort01 name1 lifnr

FROM lfa1 INTO TABLE int_lfa1

FOR ALL ENTRIES IN int_ekko WHERE lifnr EQ int_ekko-lifnr.

ENDIF.

4 REPLIES 4
Read only

Former Member
0 Likes
594

Hi Ajay ,

Press F1 on Append statement.

you forgot to append the records in below code :



LOOP AT int_j_1iexcdtl INTO wa_j_1iexcdtl.
MOVE wa_j_1iexcdtl-rdoc1 TO wa_itab2-ebeln.
MOVE wa_j_1iexcdtl-ritem1 TO wa_itab2-ebelp.
"Append should be in this place
ENDLOOP.

Hope this resolves your issue.

Edited by: Harsh Bhalla on Jan 21, 2010 5:06 PM

Read only

0 Likes
593

hi

i also want to put mswkz and orto1, name1 in wa_final

i guess i need 2 use READ statements but how 2 put in d Logical Exp conds .....???

m confused .............Pls gimme d proper code.

Thanks n Regards,

Ajay

Read only

Former Member
0 Likes
593

hi,

LOOP AT int_j_1iexcdtl INTO wa_j_1iexcdtl.
MOVE wa_j_1iexcdtl-rdoc1 TO wa_itab2-ebeln.
MOVE wa_j_1iexcdtl-ritem1 TO wa_itab2-ebelp.
append wa_itab2 to itab2.
clear wa_itab2.
clear wa_j_1iexcdtl.
ENDLOOP.

IF int_j_1iexcdtl[] IS NOT INITIAL.
SELECT ebeln
ebelp
matnr
bukrs
mwskz
FROM ekpo INTO TABLE int_ekpo
FOR ALL ENTRIES IN itab2 WHERE ebeln EQ itab2-ebeln
AND ebelp EQ itab2-ebelp.
endif.

IF int_ekko[] IS NOT INITIAL.
SELECT ort01 name1 lifnr
FROM lfa1 INTO TABLE int_lfa1
FOR ALL ENTRIES IN int_ekko WHERE lifnr EQ int_ekko-lifnr.
ENDIF.

regards

Gaurav

Read only

Former Member
0 Likes
593

hi ,

READ TABLE <internal tab> INTO WA  WITH KEY <field> = WA-<field>.
    IF SY-SUBRC = 0.
      WA_final-<field1> = WA-<field1>.
     WA_final-<field2> = WA-<field2>.
     WA_final-<field3> = WA-<field3>.
    ENDIF.

regards

Gaurav