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: 

NO BATCH INPUT DATA FOR SCREEN SAPMSRDO(SE11)

Former Member
0 Kudos

hai experts

i dont receive the batch input data for particular screen(program=sapmsrdo and dynpro = 102). plz recover this problem. here my bdc coding shown below. but the program is executed .then afterwards i press the process button for particular session name'surender' using sm35. the se11 screen is come but the batch input data for particular screen is not come.

REPORT YSUSBDC8.

DATA: IT_EXCEL LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.

DATA: BDC_TAB LIKE BDCDATA OCCURS 10 WITH HEADER LINE.

DATA: BEGIN OF IT_DATA OCCURS 0,

NAME LIKE YSUSTAB1-NAME,

ROLLNO LIKE YSUSTAB1-ROLLNO,

END OF IT_DATA.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

FILENAME = 'D:\BOOK1.XLS'

I_BEGIN_COL = 1

I_BEGIN_ROW = 1

I_END_COL = 10

I_END_ROW = 65536

TABLES

INTERN = IT_EXCEL

EXCEPTIONS

INCONSISTENT_PARAMETERS = 1

UPLOAD_OLE = 2

OTHERS = 3

.

IF SY-SUBRC 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

LOOP AT IT_EXCEL.

CASE IT_EXCEL-COL.

WHEN '001'.

IT_DATA-NAME = IT_EXCEL-VALUE.

WHEN '002'.

IT_DATA-ROLLNO = IT_EXCEL-VALUE.

ENDCASE.

AT END OF ROW.

APPEND IT_DATA.

CLEAR IT_DATA.

ENDAT.

ENDLOOP.

LOOP AT IT_DATA.

WRITE: / IT_DATA-NAME COLOR 6, SY-VLINE,IT_DATA-ROLLNO COLOR 7.

ULINE.

ENDLOOP.

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

CLIENT = SY-MANDT

  • DEST = FILLER8

GROUP = 'SURENDER'

  • HOLDDATE = FILLER8

KEEP = 'X'

USER = SY-UNAME

  • RECORD = FILLER1

PROG = SY-CPROG.

  • IMPORTING

  • QID =

  • EXCEPTIONS

  • CLIENT_INVALID = 1

  • DESTINATION_INVALID = 2

  • GROUP_INVALID = 3

  • GROUP_IS_LOCKED = 4

  • HOLDDATE_INVALID = 5

  • INTERNAL_ERROR = 6

  • QUEUE_ERROR = 7

  • RUNNING = 8

  • SYSTEM_LOCK_ERROR = 9

  • USER_INVALID = 10

  • OTHERS = 11

.

IF SY-SUBRC 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

LOOP AT IT_DATA.

BDC_TAB-PROGRAM = 'SAPMSRDO'.

BDC_TAB-DYNPRO = '102'.

BDC_TAB-DYNBEGIN = 'X'.

APPEND BDC_TAB.

CLEAR BDC_TAB.

BDC_TAB-FNAM = 'RSRD1-TBMA'.

BDC_TAB-FVAL = 'X'.

APPEND BDC_TAB.

CLEAR BDC_TAB.

BDC_TAB-FNAM = 'YSUSTAB1'.

BDC_TAB-FVAL = 'RSRD1-TBMA_VAL'.

APPEND BDC_TAB.

CLEAR BDC_TAB.

BDC_TAB-FNAM = 'BDC_OKCODE'.

BDC_TAB-FVAL = 'EDIT'.

APPEND BDC_TAB.

CLEAR BDC_TAB.

BDC_TAB-PROGRAM = 'SAPLSD41'.

BDC_TAB-DYNPRO = '2200'.

BDC_TAB-DYNBEGIN = 'X'.

APPEND BDC_TAB.

CLEAR BDC_TAB.

BDC_TAB-FNAM = 'BDC_OKCODE'.

BDC_TAB-FVAL = 'TDED'.

APPEND BDC_TAB.

CLEAR BDC_TAB.

BDC_TAB-PROGRAM = '/1BCDWB/DBYSUSTAB1'.

BDC_TAB-DYNPRO = '101'.

BDC_TAB-DYNBEGIN = 'X'.

APPEND BDC_TAB.

CLEAR BDC_TAB.

BDC_TAB-FNAM = 'YSUSTAB1-ROLLNO'.

BDC_TAB-FVAL = IT_DATA-ROLLNO.

APPEND BDC_TAB.

CLEAR BDC_TAB.

BDC_TAB-FNAM = 'YSUSTAB1-NAME'.

BDC_TAB-FVAL = IT_DATA-NAME.

APPEND BDC_TAB.

CLEAR BDC_TAB.

BDC_TAB-FNAM = 'BDC_OKCODE'.

BDC_TAB-FVAL = 'SAVE'.

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'SE11'

  • POST_LOCAL = NOVBLOCAL

  • PRINTING = NOPRINT

  • SIMUBATCH = ' '

  • CTUPARAMS = ' '

TABLES

DYNPROTAB = BDC_TAB.

  • EXCEPTIONS

  • INTERNAL_ERROR = 1

  • NOT_OPEN = 2

  • QUEUE_ERROR = 3

  • TCODE_INVALID = 4

  • PRINTING_INVALID = 5

  • POSTING_INVALID = 6

  • OTHERS = 7

.

IF SY-SUBRC 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDLOOP.

CALL FUNCTION 'BDC_CLOSE_GROUP'

  • EXCEPTIONS

  • NOT_OPEN = 1

  • QUEUE_ERROR = 2

  • OTHERS = 3

.

IF SY-SUBRC 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

regards

surender

3 REPLIES 3

Former Member
0 Kudos

hi,

REPORT YSUSBDC8.

DATA: IT_EXCEL LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.

DATA: BDC_TAB LIKE BDCDATA OCCURS 10 WITH HEADER LINE.

DATA: BEGIN OF IT_DATA OCCURS 0,

NAME LIKE YSUSTAB1-NAME,

ROLLNO LIKE YSUSTAB1-ROLLNO,

END OF IT_DATA.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

FILENAME = 'D:\BOOK1.XLS'

I_BEGIN_COL = 1

I_BEGIN_ROW = 1

I_END_COL = 10

I_END_ROW = 65536

TABLES

INTERN = IT_EXCEL

EXCEPTIONS

INCONSISTENT_PARAMETERS = 1

UPLOAD_OLE = 2

OTHERS = 3

.

IF SY-SUBRC 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

LOOP AT IT_EXCEL.

CASE IT_EXCEL-COL.

WHEN '001'.

IT_DATA-NAME = IT_EXCEL-VALUE.

WHEN '002'.

IT_DATA-ROLLNO = IT_EXCEL-VALUE.

ENDCASE.

AT END OF ROW.

APPEND IT_DATA.

CLEAR IT_DATA.

ENDAT.

ENDLOOP.

LOOP AT IT_DATA.

WRITE: / IT_DATA-NAME COLOR 6, SY-VLINE,IT_DATA-ROLLNO COLOR 7.

ULINE.

ENDLOOP.

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

CLIENT = SY-MANDT

  • DEST = FILLER8

GROUP = 'SURENDER'

  • HOLDDATE = FILLER8

KEEP = 'X'

USER = SY-UNAME

  • RECORD = FILLER1

PROG = SY-CPROG.

  • IMPORTING

  • QID =

  • EXCEPTIONS

  • CLIENT_INVALID = 1

  • DESTINATION_INVALID = 2

  • GROUP_INVALID = 3

  • GROUP_IS_LOCKED = 4

  • HOLDDATE_INVALID = 5

  • INTERNAL_ERROR = 6

  • QUEUE_ERROR = 7

  • RUNNING = 8

  • SYSTEM_LOCK_ERROR = 9

  • USER_INVALID = 10

  • OTHERS = 11

.

IF SY-SUBRC 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

LOOP AT IT_DATA.

BDC_TAB-PROGRAM = 'SAPMSRDO'.

BDC_TAB-DYNPRO = '102'.

BDC_TAB-DYNBEGIN = 'X'.

APPEND BDC_TAB.

CLEAR BDC_TAB.

BDC_TAB-FNAM = 'RSRD1-TBMA'.

BDC_TAB-FVAL = 'X'.

APPEND BDC_TAB.

CLEAR BDC_TAB.

BDC_TAB-FNAM = 'YSUSTAB1'.

BDC_TAB-FVAL = 'RSRD1-TBMA_VAL'.

APPEND BDC_TAB.

CLEAR BDC_TAB.

BDC_TAB-FNAM = 'BDC_OKCODE'.

BDC_TAB-FVAL = 'EDIT'.

APPEND BDC_TAB.

CLEAR BDC_TAB.

BDC_TAB-PROGRAM = 'SAPLSD41'.

BDC_TAB-DYNPRO = '2200'.

BDC_TAB-DYNBEGIN = 'X'.

APPEND BDC_TAB.

CLEAR BDC_TAB.

BDC_TAB-FNAM = 'BDC_OKCODE'.

BDC_TAB-FVAL = 'TDED'.

APPEND BDC_TAB.

CLEAR BDC_TAB.

BDC_TAB-PROGRAM = '/1BCDWB/DBYSUSTAB1'.

BDC_TAB-DYNPRO = '101'.

BDC_TAB-DYNBEGIN = 'X'.

APPEND BDC_TAB.

CLEAR BDC_TAB.

BDC_TAB-FNAM = 'YSUSTAB1-ROLLNO'.

BDC_TAB-FVAL = IT_DATA-ROLLNO.

APPEND BDC_TAB.

CLEAR BDC_TAB.

BDC_TAB-FNAM = 'YSUSTAB1-NAME'.

BDC_TAB-FVAL = IT_DATA-NAME.

APPEND BDC_TAB.

CLEAR BDC_TAB.

BDC_TAB-FNAM = 'BDC_OKCODE'.

BDC_TAB-FVAL = 'SAVE'.

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'SE11'

Refresh bdcdata.

  • POST_LOCAL = NOVBLOCAL

  • PRINTING = NOPRINT

  • SIMUBATCH = ' '

  • CTUPARAMS = ' '

TABLES

DYNPROTAB = BDC_TAB.

  • EXCEPTIONS

  • INTERNAL_ERROR = 1

  • NOT_OPEN = 2

  • QUEUE_ERROR = 3

  • TCODE_INVALID = 4

  • PRINTING_INVALID = 5

  • POSTING_INVALID = 6

  • OTHERS = 7

.

IF SY-SUBRC 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDLOOP.

CALL FUNCTION 'BDC_CLOSE_GROUP'

  • EXCEPTIONS

  • NOT_OPEN = 1

  • QUEUE_ERROR = 2

  • OTHERS = 3

.

IF SY-SUBRC 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Make the following changes, Hope it works.

0 Kudos

while am insert the statement refresh bdcdata inside the call function bdc_insert . it depict the error such as = ..

expected after REFRESH.

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'SE11'

REFRESH BDC_TAB.

TABLES

DYNPROTAB = BDC_TAB.

0 Kudos

Hi

CALL FUNCTION 'BDC_INSERT'

EXPORTING

TCODE = 'SE11'

  • POST_LOCAL = NOVBLOCAL

  • PRINTING = NOPRINT

  • SIMUBATCH = ' '

  • CTUPARAMS = ' '

TABLES

DYNPROTAB = BDC_TAB.

  • EXCEPTIONS

  • INTERNAL_ERROR = 1

  • NOT_OPEN = 2

  • QUEUE_ERROR = 3

  • TCODE_INVALID = 4

  • PRINTING_INVALID = 5

  • POSTING_INVALID = 6

  • OTHERS = 7

.

IF SY-SUBRC 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

REFRESH BDC_TAB.

ENDLOOP.

Keep the statement refresh bdc_tab just before the end loop statement as shown above.

Reward points if useful.

Regards,

sasi