Skip to Content
0
Former Member
May 08, 2007 at 03:24 AM

doubt in bdc program session method

10 Views

hi,

I tried to execute this program..i am getting error in the bolded line..can you give suggestions..

REPORT ZPRABA1.

TABLES:LFA1.

DATA:BEGIN OF IT_ITAB OCCURS 0,

LIFNR LIKE LFA1-LIFNR,

LAND1 LIKE LFA1-LAND1,

NAME1 LIKE LFA1-NAME1,

END OF IT_ITAB.

DATA:BEGIN OF IT_JTAB OCCURS 0,

<b>* Error is showing in the below line..that means i have to create new structure or

  • what?</b>

<b>INCLUDE STRUCTURE BDCDATA.</b>

END OF IT_JTAB.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD

FILENAME = 'C:/praba.txt'

FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = 'X'

CHANGING

DATA_TAB = IT_ITAB[].

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

CLIENT = SY-MANDT

GROUP = 'USER01'

USER = SY-UNAME.

LOOP AT IT_ITAB[] INTO IT_ITAB.

REFRESH IT_JTAB.

PERFORM SUB USING 'YVTRANS' '0100'.

PERFORM SUB1 USING 'LFA1-LIFNR' ITAB-LIFNR,

PERFORM SUB1 USING 'LFA1-LAND1' ITAB-LAND1,

PERFORM SUB1 USING 'LFA1-NAME1' ITAB-NAME.

PERFORM SUB1 USING 'BDC_OKCODE' 'INSERT'.

PERFORM SUB USING 'YSBDC1' '100'.

PERFORM SUB1 USING 'BDC_OKCODE' 'EXIT'.

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'YSBDC1'

TABLES

DYNPROTAB = IT_JTAB.

ENDLOOP.

CALL FUNCTION 'BDC_CLOSE_GROUP'.

SUBMIT RSBDCSUB VIA SELECTION-SCREEN.

FORM SUB USING A B.

CLEAR IT_JTAB.

IT_JTAB-PROGRAM = A.

IT_JTAB-DYNPRO = B.

IT_JTAB-DYNBEGIN = 'X'.

ENDFORM.