Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

bdc recording

when i run my bdc it show that data saved properly but when i go through the details no data will save .

i mean to say that my bdc is running properly but dose not able to save my data .

i m sending you my code.

report ZCONDRECORD1

no standard page heading line-size 255.

include bdcrecx1.

data: begin of IT_FINAL OCCURS 0,

KSCHL_001(004),

WERKS_002(004),

LIFNR_003(010),

MATNR_01_004(018),

KBETR_01_005(016),

MWSK1_01_006(002),

end of IT_FINAL.

DATA: BEGIN OF L_INTERN OCCURS 0.

INCLUDE STRUCTURE ALSMEX_TABLINE .

DATA: END OF L_INTERN.

  • * Selection Screen....................................

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETERS: P_FILE LIKE RLGRAP-FILENAME

DEFAULT '' OBLIGATORY. " File Name

SELECTION-SCREEN END OF BLOCK B1.

  • At Selection Screen Event...........................

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

dynpro_number = syst-dynnr

field_name = ' '

IMPORTING

file_name = p_file.

*start-of-selection.

PERFORM UPLOAD_FILE TABLES IT_FINAL

USING P_FILE.

start-of-selection.

perform open_group.

LOOP AT IT_FINAL.

perform bdc_dynpro using 'SAPMV13A' '0100'.

perform bdc_field using 'BDC_CURSOR'

'RV13A-KSCHL'.

perform bdc_field using 'BDC_OKCODE'

'=ANTA'.

perform bdc_field using 'RV13A-KSCHL'

IT_FINAL-KSCHL_001.

perform bdc_dynpro using 'SAPLV14A' '0100'.

perform bdc_field using 'BDC_CURSOR'

'RV130-SELKZ(01)'.

perform bdc_field using 'BDC_OKCODE'

'=WEIT'.

perform bdc_dynpro using 'SAPMV13A' '1363'.

perform bdc_field using 'BDC_CURSOR'

'KONP-KBETR(01)'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'KOMG-WERKS'

IT_FINAL-WERKS_002.

perform bdc_field using 'KOMG-LIFNR'

IT_FINAL-LIFNR_003.

perform bdc_field using 'KOMG-MATNR(01)'

IT_FINAL-MATNR_01_004.

perform bdc_field using 'KONP-KBETR(01)'

IT_FINAL-KBETR_01_005.

perform bdc_field using 'KONP-MWSK1(01)'

IT_FINAL-MWSK1_01_006.

perform bdc_dynpro using 'SAPMV13A' '1363'.

perform bdc_field using 'BDC_CURSOR'

'KOMG-MATNR(01)'.

perform bdc_field using 'BDC_OKCODE'

'=SICH'.

perform bdc_transaction using 'FV11'.

ENDLOOP.

perform close_group.

FORM UPLOAD_FILE TABLES P_TABLE

USING P_FILE.

  • Data Declarations.......................................

DATA : L_INDEX TYPE I.

DATA : L_START_COL TYPE I VALUE '1',

L_START_ROW TYPE I VALUE '2',

L_END_COL TYPE I VALUE '256',

L_END_ROW TYPE I VALUE '65536'.

  • Field Symbols...........................................

FIELD-SYMBOLS : <FS>.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

FILENAME = P_FILE

I_BEGIN_COL = '1'

I_BEGIN_ROW = '2'

I_END_COL = '100'

I_END_ROW = '40000'

TABLES

INTERN = L_INTERN

EXCEPTIONS

INCONSISTENT_PARAMETERS = 1

UPLOAD_OLE = 2

OTHERS = 3 .

IF sy-subrc NE 0.

FORMAT COLOR COL_BACKGROUND INTENSIFIED.

WRITE : / 'File Error'.

EXIT.

ENDIF.

IF L_INTERN[] IS INITIAL.

FORMAT COLOR COL_BACKGROUND INTENSIFIED.

WRITE : / 'No Data Uploaded'.

EXIT.

ELSE.

SORT L_INTERN BY ROW COL.

LOOP AT L_INTERN.

MOVE L_INTERN-COL TO L_INDEX.

ASSIGN COMPONENT L_INDEX OF STRUCTURE P_TABLE TO <FS>.

MOVE L_INTERN-VALUE TO <FS>.

AT END OF ROW.

APPEND P_TABLE.

CLEAR P_TABLE.

ENDAT.

ENDLOOP.

ENDIF.

ENDFORM.

Tags:
Not what you were looking for? View more on this topic or Ask a question