Skip to Content
0
Former Member
Jun 11, 2007 at 01:03 PM

bdc problem

38 Views

Hi all,

i developed a bdc program for transaction aco3. (sesion method).

its working fine. i transported it to production client. wen i run the bdc. session is created. wen i process the sesion in foreground it is taking to aco3 transaction,here values are not populating.its showing the message fill the required fields.

the same file i gave it in development its working fine.

program is below

include bdcrecx1.

parameters: filename like rlgrap-filename.

data: begin of record,

ASNUM(18),

ASKTX(40),

ASTYP(4),

MEINS(3),

MATKL(6),

BKLAS(4),

end of record.

data: itab_program like record occurs 0 with header line.

***

****************************************************

  • At Selection Screen

****************************************************

at selection-screen on value-request for filename.

perform query_filename changing filename.

****************************************************

*START-OF-SELECTION

*****************************************************

start-of-selection.

*-- Upload flat data to ITAB.

perform upload_to_itab.

*{ chg001 -- modified as per requirement

perform open_group.

loop at itab_program.

perform upload_programs.

endloop.

perform close_group.

----


  • FORM UPLOAD_TO_ITAB *

----


  • ........ *

----


form upload_to_itab.

call function 'WS_UPLOAD'

exporting

  • CODEPAGE = ' '

filename = filename

filetype = 'DAT'

  • HEADLEN = ' '

  • LINE_EXIT = ' '

  • TRUNCLEN = ' '

  • USER_FORM = ' '

  • USER_PROG = ' '

  • DAT_D_FORMAT = ' '

  • IMPORTING

  • FILELENGTH =

tables

data_tab = itab_program

  • EXCEPTIONS

  • CONVERSION_ERROR = 1

  • FILE_OPEN_ERROR = 2

  • FILE_READ_ERROR = 3

  • INVALID_TYPE = 4

  • NO_BATCH = 5

  • UNKNOWN_ERROR = 6

  • INVALID_TABLE_WIDTH = 7

  • GUI_REFUSE_FILETRANSFER = 8

  • CUSTOMER_ERROR = 9

  • OTHERS = 10

.

if sy-subrc <> 0.

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

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

write : 'File opening error.'.

endif.

endform.

----


  • FORM QUERY_FILENAME *

----


  • ........ *

----


  • --> P_FILENAME *

----


form query_filename changing p_filename.

data : tmp_filename like filename.

call function 'WS_FILENAME_GET'

exporting

def_filename = filename

mask = ',.txt,.txt.'

mode = 'O'

title = 'Select the file to Upload'

importing

filename = tmp_filename

exceptions

inv_winsys = 01

no_batch = 02

selection_cancel = 03

selection_error = 04.

if sy-subrc = 0.

filename = tmp_filename.

endif.

endform.

*******************************************

*perform open_group.

&----


*& Form UPLOAD_programs

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form upload_programs.

perform bdc_dynpro using 'SAPLBAS0' '0300'.

perform bdc_field using 'BDC_CURSOR'

'ASMD-ASNUM'.

perform bdc_field using 'BDC_OKCODE'

'=NEW'.

perform bdc_field using 'RM63T-SPRAS'

'EN'.

perform bdc_dynpro using 'SAPLBAS0' '0300'.

perform bdc_field using 'BDC_CURSOR'

'ASMD-MATKL'.

perform bdc_field using 'BDC_OKCODE'

'=POST'.

perform bdc_field using 'ASMD-ASNUM'

itab_program-ASNUM.

perform bdc_field using 'ASMDT-ASKTX'

itab_program-ASKTX.

perform bdc_field using 'ASMD-ASTYP'

itab_program-ASTYP.

perform bdc_field using 'ASMD-MEINS'

itab_program-MEINS.

perform bdc_field using 'ASMD-MATKL'

itab_program-MATKL.

perform bdc_field using 'ASMD-BKLAS'

itab_program-BKLAS.

perform bdc_dynpro using 'SAPLBAS0' '0300'.

perform bdc_field using 'BDC_OKCODE'

'/EBACK'.

perform bdc_field using 'BDC_CURSOR'

'ASMD-ASNUM'.

perform bdc_dynpro using 'SAPLSPO1' '0100'.

perform bdc_field using 'BDC_OKCODE'

'=YES'.

perform bdc_transaction using 'AC03'.

endform. " UPLOAD_programs

can any body help me in this regard.

thanks in advance

siva