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 SESSION METHOD

Former Member
0 Kudos
92

REPORT ZBDC .

TABLES : KNA1.

  • INTERNAL TABLE FOR DATA HANDLING.

DATA : BEGIN OF ITAB OCCURS 0,

KUNNR LIKE KNA1-KUNNR,

LAND1 LIKE KNA1-LAND1,

NAME1 LIKE KNA1-NAME1,

END OF ITAB.

*INTERNAL TABLE FOR MAPPING.

DATA : JTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE.

*UPLOAD DATA TO ITAB.

CALL FUNCTION 'WS_UPLOAD'

EXPORTING

FILENAME = 'C:\SES.TXT '

FILETYPE = 'DAT'

TABLES

DATA_TAB = ITAB.

*BASIC INFORMATION.

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

CLIENT = SY-MANDT.

GROUP = 'ABC'.

HOLDDATE = SY-DATUM.

KEEP = 'X'.

USER = SY-UNAME.

*MAPPING LOGIC.

LOOP AT ITAB.

REFRESH JTAB.

PERFORM SUB1 USING 'YTRAN' 100.

PERFORM SUB2 USING 'KNA1-KUNNR' ITAB-KUNNR.

PERFORM SUB2 USING 'KNA1-LAND1' ITAB-LAND1.

PERFORM SUB2 USING 'KNA1-NAME1' ITAB-NAME1.

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'YTRAN'

TABLES

DYNPROTAB = JTAB.

ENDLOOP.

CALL FUNCTION 'BDC_CLOSE_GROUP'.

FORM SUB1 USING A B.

CLEAR JTAB.

JTAB-PROGRAM = A.

JTAB-DYNPRO = B.

JTAB-DYNBEGIN = 'X'.

APPEND JTAB.

ENDFORM.

  • TO MOVE TO FIELD LEVEL.

FORM SUB2 USING C D.

CLEAR JTAB.

JTAB-FNAM = C.

JTAB-FVAL = D.

APPEND JTAB.

ENDFORM.

ERROR:

1)FIELD "GROUP" IS UNKNOWN. IT IS NEITHER IN ONE OF THE SPECIFIED TABLES NOR DEFINED BY A "DATA" STATEMENT.

2)FIELD "HOLDDATE" IS UNKNOWN. IT IS NEITHER IN ONE OF THE SPECIFIED TABLES NOR DEFINED BY A "DATA" STATEMENT.

3)FIELD "KEEP" IS UNKNOWN. IT IS NEITHER IN ONE OF THE SPECIFIED TABLES NOR DEFINED BY A "DATA" STATEMENT.

4)FIELD "USER" IS UNKNOWN. IT IS NEITHER IN ONE OF THE SPECIFIED TABLES NOR DEFINED BY A "DATA" STATEMENT.

4 REPLIES 4

amit_khare
Active Contributor
0 Kudos
63

Change the following FM as below.

<b>

*BASIC INFORMATION.

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

client = sy-mandt

group = 'ABC'

holddate = sy-datum

keep = 'X'

user = sy-uname.

</b>

Thats is remove full stops from each line of FM.

Regards,

Amit

Reward all helpful replies.

Former Member
0 Kudos
63

Hi Lakshmi,

In u r function moduledefination u keep '.' at last. it should not be there. Remove that and try agagin

Hope this helps you. Check in all function modules as same.

Reply for queries.

Regards,

Kumar.

0 Kudos
63

HOW TO EXECUTE THIS SESSION METHOD.

WHEN I WENT TO SM35, THEN SELECTED THE SESSION ,THEN I GAVE PROCESS.

ERROR : THE REQUESTED SESSION IS LOCKED

Former Member
0 Kudos
63

Hi Lakshmi,

the session is being processed..that is the reason why it is locked...select the session and press shift+F9..

hope this helps u a bit,

all the best,

regards,

sampath

  • mark helpful answers