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

bdc

Former Member
0 Likes
449

any body can plz execute this program and tell me the changes to be done and plz send me the code for this

ZKA_SCREENPAINTER program

plz tell me everything in detail

REPORT ZKA_BDC .

TABLES: ZKA_EMP.

DATA: ITAB LIKE ZKA_EMP OCCURS 0 WITH HEADER LINE.

DATA: BDCITAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE.

DATA: ITAB_COMMA LIKE ITAB OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'UPLOAD'

EXPORTING

  • CODEPAGE = ' '

FILENAME = ' '

FILETYPE = ' '

  • ITEM = ' '

  • FILEMASK_MASK = ' '

  • FILEMASK_TEXT = ' '

  • FILETYPE_NO_CHANGE = ' '

  • FILEMASK_ALL = ' '

  • FILETYPE_NO_SHOW = ' '

  • LINE_EXIT = ' '

  • USER_FORM = ' '

  • USER_PROG = ' '

  • SILENT = 'S'

  • IMPORTING

  • FILESIZE =

  • CANCEL =

  • ACT_FILENAME =

  • ACT_FILETYPE =

TABLES

DATA_TAB = ITAB

  • EXCEPTIONS

  • CONVERSION_ERROR = 1

  • INVALID_TABLE_WIDTH = 2

  • INVALID_TYPE = 3

  • NO_BATCH = 4

  • UNKNOWN_ERROR = 5

  • GUI_REFUSE_FILETRANSFER = 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.

LOOP AT ITAB.

WRITE:/ ITAB.

ENDLOOP.

LOOP AT ITAB.

SPLIT ITAB AT ',' INTO

ITAB_COMMA-EMPNO

ITAB_COMMA-EMPNAME

ITAB_COMMA-EMPPHONE

ITAB_COMMA-EMPID.

APPEND ITAB_COMMA.

CLEAR ITAB_COMMA.

ENDLOOP.

LOOP AT ITAB_COMMA.

BDCITAB-PROGRAM = 'ZKA_SCREENPAINTER'.

BDCITAB-DYNPRO = '0001'.

BDCITAB-DYNBEGIN = 'X'.

APPEND BDCITAB.

CLEAR BDCITAB.

BDCITAB-FNAM = 'ZKA_EMP-EMPNO'.

BDCITAB-FVAL = ITAB_COMMA-EMPNO.

APPEND BDCITAB.

CLEAR BDCITAB.

BDCITAB-FNAM = 'ZKA_EMP-EMPNAME'.

BDCITAB-FVAL = ITAB_COMMA-EMPNAME.

APPEND BDCITAB.

CLEAR BDCITAB.

BDCITAB-FNAM = 'ZKA_EMP-EMPPHONE'.

BDCITAB-FVAL = ITAB_COMMA-EMPPHONE.

APPEND BDCITAB.

CLEAR BDCITAB.

BDCITAB-FNAM = 'ZKA_EMP-EMPID'.

BDCITAB-FVAL = ITAB_COMMA-EMPID.

APPEND BDCITAB.

CLEAR BDCITAB.

ENDLOOP.

CALL TRANSACTION 'ZKA_TRNEMP' USING BDCITAB MODE 'A'.

5 REPLIES 5
Read only

Former Member
0 Likes
430

Are you: -

Mad

Lazy

Useless

Please select any or all of the above.

Read only

Former Member
0 Likes
430

hi,

In your program everything looks good. but u r not mentioning the File name and file type in 'UPLOAD' Function module.. File type should be 'ASC' or 'BIN' depends on your requirement and uncomment the Exceptions.

Read only

Former Member
0 Likes
430

LOOP AT ITAB.

WRITE:/ ITAB.

ENDLOOP.

this piece of code is waste,what do you want to do with this?to print the value of an itab you should write its fields

Read only

Former Member
0 Likes
430

Hi,

Seems u r new to sap. U need to remove the comments on the required places in order to execute the program.

Below is your modified code.

REPORT ZKA_BDC .

TABLES: ZKA_EMP.

DATA: ITAB LIKE ZKA_EMP OCCURS 0 WITH HEADER LINE.

DATA: BDCITAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE.

DATA: ITAB_COMMA LIKE ITAB OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'UPLOAD'

EXPORTING

  • CODEPAGE = ' '

FILENAME = ' ' “Specify a path for the file .

FILETYPE = ' ' “ specify the file type such as Asc, Txt, etc.

  • ITEM = ' '

  • FILEMASK_MASK = ' '

  • FILEMASK_TEXT = ' '

  • FILETYPE_NO_CHANGE = ' '

  • FILEMASK_ALL = ' '

  • FILETYPE_NO_SHOW = ' '

  • LINE_EXIT = ' '

  • USER_FORM = ' '

  • USER_PROG = ' '

  • SILENT = 'S'

  • IMPORTING

  • FILESIZE =

  • CANCEL =

  • ACT_FILENAME =

  • ACT_FILETYPE =

TABLES

DATA_TAB = ITAB

  • EXCEPTIONS “ Provide any exceptions if required as per the program and requirement

  • CONVERSION_ERROR = 1

  • INVALID_TABLE_WIDTH = 2

  • INVALID_TYPE = 3

  • NO_BATCH = 4

  • UNKNOWN_ERROR = 5

  • GUI_REFUSE_FILETRANSFER = 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.

LOOP AT ITAB.

WRITE:/ ITAB.

ENDLOOP.

LOOP AT ITAB.

SPLIT ITAB AT ',' INTO

ITAB_COMMA-EMPNO

ITAB_COMMA-EMPNAME

ITAB_COMMA-EMPPHONE

ITAB_COMMA-EMPID.

APPEND ITAB_COMMA.

CLEAR ITAB_COMMA.

ENDLOOP.

LOOP AT ITAB_COMMA.

BDCITAB-PROGRAM = 'ZKA_SCREENPAINTER'.

BDCITAB-DYNPRO = '0001'.

BDCITAB-DYNBEGIN = 'X'.

APPEND BDCITAB.

CLEAR BDCITAB.

BDCITAB-FNAM = 'ZKA_EMP-EMPNO'.

BDCITAB-FVAL = ITAB_COMMA-EMPNO.

APPEND BDCITAB.

CLEAR BDCITAB.

BDCITAB-FNAM = 'ZKA_EMP-EMPNAME'.

BDCITAB-FVAL = ITAB_COMMA-EMPNAME.

APPEND BDCITAB.

CLEAR BDCITAB.

BDCITAB-FNAM = 'ZKA_EMP-EMPPHONE'.

BDCITAB-FVAL = ITAB_COMMA-EMPPHONE.

APPEND BDCITAB.

CLEAR BDCITAB.

BDCITAB-FNAM = 'ZKA_EMP-EMPID'.

BDCITAB-FVAL = ITAB_COMMA-EMPID.

APPEND BDCITAB.

CLEAR BDCITAB.

ENDLOOP.

CALL TRANSACTION 'ZKA_TRNEMP' USING BDCITAB MODE 'A'.

Hope this is Helpful to resolve ur problem.

Reward if ur problem is solved and also close the thread if solved.

Regards.

Read only

Former Member
0 Likes
430

Are you really nuts or are you doing this just to annoy people?