Application Development 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: 

BDC

Former Member
0 Kudos

HI FRIENDS,

THIS A BDC PRO...

  • FIRST SCREEN

LOOP AT ITAB.

PERFORM SCREEN USING 'SAPMF02K' '105'.

PERFORM FIELD USING 'RF02K-LIFNR' ITAB-LIFNR.

PERFORM FIELD USING 'RF02K-BUKRS' ITAB-BURKS.

perform FIELD USING 'RF02K-KTOKK' ITAB-KTOKK.

PERFORM FIELD USING 'BDC_OKCODE' '/00'.

  • SECOND SCREEN

  • LOOP AT ITAB.

PERFORM SCREEN USING 'SAPMF02K' '0110'.

PERFORM FIELD USING 'LFA1-ANRED' ITAB-ANRED.

PERFORM FIELD USING 'LFA1-NAME1' ITAB-NAME1.

PERFORM FIELD USING 'LFA1-SORTL' ITAB-SORTL.

  • ENDLOOP.

PERFORM FIELD USING 'LFA1-LAND1' ITAB-LAND1.

PERFORM FIELD USING 'BDC_OKCODE' '/00'.

  • THIRD SCREEN

PERFORM SCREEN USING 'SAPMF02K' '0120'.

PERFORM FIELD USING 'BDC_OKCODE' '/00'.

  • FOURTH SCREEN

PERFORM SCREEN USING 'SAPMF02K' '0130'.

PERFORM FIELD USING 'BDC_OKCODE' '/00'.

  • FIFTH SCREEN

PERFORM SCREEN USING 'SAPMF02K' '210'.

PERFORM FIELD USING 'BDC_CURSOR' 'LFB1-AKONT'.

PERFORM FIELD USING 'LFB1-AKONT' ITAB-AKONT.

PERFORM FIELD USING 'LFB1-FDGRV' ITAB-FDGRV.

PERFORM FIELD USING 'BDC_OKCODE' '/00'.

  • SIXTH SCREEN

perform SCREEN USING 'SAPMF02K' '215'.

PERFORM FIELD USING 'BDC_OKCODE' '/00'.

  • SEVENTH SCREEN

perform SCREEN USING 'SAPMF02K' '220'.

PERFORM FIELD USING 'BDC_OKCODE' '/00'.

PERFORM FIELD USING 'BDC_OKCODE' '=SAVE'.

PERFORM SCREEN USING 'SAPLSP01' '0300'.

PERFORM FIELD USING 'BDC_OKCODE' '=YES'.

CALL TRANSACTION 'FK01' USING JTAB MODE 'A'.

PERFORM FIELD USING 'BDC_OKCODE' '=CLEA'.

ENDLOOP.

FORM SCREEN USING PRO DYN.

JTAB-PROGRAM = PRO.

JTAB-DYNPRO = DYN.

JTAB-DYNBEGIN = 'X'.

APPEND JTAB.

CLEAR JTAB.

ENDFORM.

FORM FIELD USING FNAME FVALUE.

JTAB-FNAM = FNAME.

JTAB-FVAL = FVALUE.

APPEND JTAB.

CLEAR JTAB.

ENDFORM.

HERE I HAVE GIVEN A LOOP AND IT IS NOT ACCEPTING MORE THAN ONE RECORD.IS THERE ANY SOLUTION FOR IT.

WITH REGARS,

MADHURI.

6 REPLIES 6

Former Member
0 Kudos

HI,

In the second screen population try placing the following statement outside the LOOP

  • SECOND SCREEN

<b>PERFORM SCREEN USING 'SAPMF02K' '0110'</b>

  • LOOP AT ITAB.

<b>PERFORM SCREEN USING 'SAPMF02K' '0110'.</b> <b>-> This is not to be in loop</b>

PERFORM FIELD USING 'LFA1-ANRED' ITAB-ANRED.

PERFORM FIELD USING 'LFA1-NAME1' ITAB-NAME1.

PERFORM FIELD USING 'LFA1-SORTL' ITAB-SORTL.

  • ENDLOOP.

Also Refresh the BDCDATA table after every CALL to TRANSACTION in the LOOP.

Naveen.

Former Member
0 Kudos

hi,

each time after CALL TRANSACTION statement u have to refresh the JTAB internal table.

0 Kudos

i tried it but its vein it not reading second record form flat file.......

Former Member
0 Kudos

Hi Madhuri,

There are 2 problems in your BDC ....

First...

CALL TRANSACTION 'FK01' USING JTAB MODE 'A'.

This statement gets the flow of program to T Code FK01 in the first LOOP ...ENDloop pass...

so it never gets to second loop pass...

<b>so you should put this CALL TRANSACTION....statement after ENDLOOP statement.</b>

Second is..

<b>put REFRESH JTAB. statement just after LOOP at ITAB statement.</b>

This will solve our issue.

<b>Reward points for helpful answer,</b>

Regards,

Tejas

0 Kudos

THANK U MY PROBLEM GOT SOLVED....

Former Member
0 Kudos

hi,

try to give a refresh itab .... otherwise it will keep in reading ur old record only in the loop

CALL TRANSACTION 'FK01' USING JTAB MODE 'A'.

<b> REFRESH ITAB.</b>

PERFORM FIELD USING 'BDC_OKCODE' '=CLEA'.

ravi

reward wil be helpful