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 Program for MM01

Former Member
0 Likes
804

Hey guys i have written a BDC for mm01 transaction for six views... well i am getting a short dump when i execute the program!!.. and the error is occuring FNAM and FVAL... can u please help me out in solving this.. Can someone also tell me the properties of FNAM and FVAL!!

Thanks & regards,

Abhishek.

6 REPLIES 6
Read only

Former Member
0 Likes
768

HI,

Check this code

FORM build_bdc_infotype USING p_mode TYPE any.

DATA: l_exdat1 TYPE char10,

l_lxdat1 TYPE char10.

WRITE i_input_line-exdat TO l_exdat1.

WRITE i_input_line-lxdat TO l_lxdat1.

REFRESH i_bdc_data.

PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.

PERFORM bdc_field USING:'RP50G-PERNR' g_pernr,

'RP50G-CHOIC' '0028',

'RP50G-SUBTY' i_input_line-subty,

'BDC_OKCODE' p_mode.

PERFORM bdc_dynpro USING 'MP002800' '2000'.

PERFORM bdc_field USING 'BDC_CURSOR' 'Q0028-NMFLD(01)'.

PERFORM bdc_field USING 'BDC_OKCODE' '=P+'.

PERFORM bdc_field USING 'P0028-EXDAT' l_exdat1.

PERFORM bdc_field USING 'P0028-RESUL' i_input_line-resul.

IF i_input_line-lxdat IS NOT INITIAL.

PERFORM bdc_field USING 'P0028-LXDAT' l_lxdat1.

ENDIF.

PERFORM bdc_dynpro USING 'MP002800' '2000'.

PERFORM bdc_field USING 'BDC_CURSOR' 'Q0028-WTFLD(03)'.

PERFORM bdc_field USING 'BDC_OKCODE' 'UPD'.

PERFORM bdc_field USING 'Q0028-WTFLD(02)' i_input_line-bldgrp.

PERFORM bdc_field USING 'Q0028-WTFLD(03)' i_input_line-rhfact.

PERFORM bdc_field USING:'BDC_OKCODE' '/00'.

IF p_test EQ c_y.

PERFORM bdc_dynpro USING 'MP002800' '2000'.

PERFORM bdc_field USING 'BDC_OKCODE' '/EBCK'.

PERFORM bdc_dynpro USING 'SAPLSPO1' '0200'.

PERFORM bdc_field USING 'BDC_OKCODE' '=YES'.

ELSE.

PERFORM bdc_dynpro USING 'MP002800' '2000'.

PERFORM bdc_field USING 'BDC_OKCODE' '=UPD'.

ENDIF.

PERFORM bdc_dynpro USING 'SAPMP50A' '1000'.

PERFORM bdc_field USING 'BDC_OKCODE' '=BACK'.

ENDFORM. "build_bdc_infotype

&----


*& Form bdc_dynpro

&----


  • To build bdc data(Program name and screen number)

----


FORM bdc_dynpro USING p_program TYPE any

p_dynpro TYPE any.

i_bdc_data_line-program = p_program.

i_bdc_data_line-dynpro = p_dynpro.

i_bdc_data_line-dynbegin = c_x.

APPEND i_bdc_data_line TO i_bdc_data.

CLEAR i_bdc_data_line.

ENDFORM. " bdc_dynpro

&----


*& Form bdc_field

&----


  • To build bdc data(Field name and BDC field value)

----


  • -->P_FNAM Field name

  • -->P_FVAL BDC field value

----


FORM bdc_field USING p_fnam TYPE any

p_fval TYPE any.

i_bdc_data_line-fnam = p_fnam.

i_bdc_data_line-fval = p_fval.

APPEND i_bdc_data_line TO i_bdc_data.

CLEAR i_bdc_data_line.

ENDFORM. " bdc_field

Read only

Former Member
0 Likes
768

FNAM is field name which is used in recording.and the values passing in fields called FVAL.

but i would suggest you to learn BDC basics.And goto se11>give BDCDATA>and display all fields of this structure and see their discription..

Read only

Former Member
0 Likes
768
Read only

Former Member
0 Likes
768

Hi,

I think you need to declare the bdc table type BDCDATA in the global declarations

try it out

regards

Ramchander Rao.K

Read only

Former Member
0 Likes
768

Hi Abhishek,

Have you included the function module bdcrecx1 using the statement include bdcrecx1?

fnam indicates the field name and fval indicates the field value.See St22 for dump analysis.

Regards,

Charumathi.B

Read only

praveen_kumar132
Participant
0 Likes
768

Hi ,

FNAM is field field name and FVAL is field value..

ex. matnr is field name and 012478963 is field value.