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 recording

Former Member
0 Kudos

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.

5 REPLIES 5

Former Member
0 Kudos

how much data in testing u upload if u upload only one data than this is the problem..

given 1st row space (empty) in excel sheet....

former_member181962
Active Contributor
0 Kudos

HI Pawan,

Which method are you using for the bdc?

Session method or call transaction?

If you are using Session method, the you need to go to sm35 to process your session.Then only the data gets saved.

Regards,

Ravi

Former Member
0 Kudos

i cudn't find the OKCODE for saving

<b>=SICH</b>

check if it is

<b>SICH</b>

Former Member
0 Kudos

HI

GOOD

HAVE YOU DONE THE RECORDING PROPERLY,IF YOU HAVE DONE THE RECORDING PROPERLY THAN IT WILL SHOW THA APPROPRIATE DATA IN THE FIELDS.

SO YOU FIRST RUN YOUR RECORDING ,AND SEE WHEATHER ALL THE FIELD CONTAIN THE DATA OR NOT.

THANKS

MRUTYUN

0 Kudos

hi

make sure the ok_code for save is being passed ...

reward points if it helps

gunjan