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

Populating Final Internal Table

Former Member
0 Likes
639

Hi Experts,

I am giving a sample code, please can any one let me know how to populate final internal table ie., gt_final here...

SELECT LIKP~VBELN "delv

LIKP~WADAT_IST "actual goods issue date

LIPS~VGBEL "po

LIPS~VGPOS "po line

INTO CORRESPONDING FIELDS OF TABLE GT_FINAL

FROM LIKP INNER JOIN LIPS

ON LIKPVBELN = LIPSVBELN "delv

WHERE LIKP~WADAT IN S_WADAT. "planned goods issue date

IF SY-SUBRC NE 0.

  • WRITE ' No records found for Processing'.

ENDIF.

LOOP AT GT_FINAL INTO GW_FINAL.

ON CHANGE OF GW_FINAL-VGPOS OR GW_FINAL-VGBEL.

SELECT SINGLE BANFN BNFPO INTO (W_BANFN, W_BNFPO)

FROM EKET

WHERE EBELN = GW_FINAL-VGBEL

AND EBELP = GW_FINAL-VGPOS.

SELECT SINGLE KOSTL INTO (W_ZSITS)

FROM EKKN

WHERE EBELN = GW_FINAL-VGBEL

AND EBELP = GW_FINAL-VGPOS.

ENDON.

MOVE: W_BANFN TO GW_FINAL-BANFN, " PR

W_BNFPO TO GW_FINAL-BNFPO, " PR Line Item

W_ZSITS TO GW_FINAL-ZSITS.

ENDLOOP.

LOOP AT GT_FINAL INTO GW_FINAL.

ON CHANGE OF GW_FINAL-BNFPO OR GW_FINAL-BANFN .

SELECT SINGLE BADAT FRGDT INTO (W_BADAT, W_FRGDT)

FROM EBAN

WHERE BANFN = GW_FINAL-BANFN

AND BNFPO = GW_FINAL-BNFPO.

SELECT SINGLE WEMPF ABLAD INTO (W_WEMPF, W_ABLAD)

FROM EBKN

WHERE BANFN = GW_FINAL-BANFN

AND BNFPO = GW_FINAL-BNFPO.

ENDON.

MOVE: W_WEMPF TO GW_FINAL-WEMPF,

W_ABLAD TO GW_FINAL-ABLAD,

W_BADAT TO GW_FINAL-BADAT,

W_FRGDT TO GW_FINAL-FRGDT.

SELECT SINGLE LGNUM REFNR QDATU INTO (W_LGNUM, W_REFNR, GW_FINAL-QDATU)

FROM LTAK

WHERE VBELN = GW_FINAL-VBELN.

IF SY-SUBRC = 0.

IF NOT W_REFNR IS INITIAL.

SELECT SINGLE QDATU INTO (GW_FINAL-QDATU_1)

FROM LTAK

WHERE LGNUM = W_LGNUM

AND REFNR = W_REFNR

AND VBELN = SPACE.

ENDIF.

ENDIF.

ENDLOOP.

I am getting only 4 values in the final table ie., from the first select query.

Thanks.

5 REPLIES 5
Read only

Former Member
0 Likes
598

Hi,

First thing is that when u r using ON CHANGE OF.

This comes outside to ur loop...endloop statement

Read only

JozsefSzikszai
Active Contributor
0 Likes
598

hi Zafeer,

in debug check yur select: what values you have in S_WADAT, thacheck in SE16 how many entries you get from LIKP with these values.

ec

Read only

Former Member
0 Likes
598

Hi Experts,

Please Help its urgent.

Thanks

Read only

Former Member
0 Likes
598

Hi Zafeer,

MOVE: W_BANFN TO GW_FINAL-BANFN, " PR
            W_BNFPO TO GW_FINAL-BNFPO, " PR Line Item
            W_ZSITS TO GW_FINAL-ZSITS.

Modify git_final from gw_final transporting banfn bnfpo zsits.

do like this after your remaining move statements, your problem will get resolved.

<b>Reward points for helpful answers</b>

Satish

Read only

Former Member
0 Likes
598

Hi Satish,

Thanks for ur reply, but why should we use transporing here.

Thanks.