Skip to Content

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

BDC Doubt

Hi Experts

I am very new to BDC programs, i created a recording for the transaction CO08(Production order Creation) using SHDB then, i converted into the following program.

Can anyone tell me, now what are the steps to be taken. I don't know the process, how to change the program and the input and run the program also.

Regards

Rajaram

report ZVD

no standard page heading line-size 255.

include bdcrecx1.

parameters: dataset(132) lower case.

      • DO NOT CHANGE - the generated data section - DO NOT CHANGE ***

*

  • If it is nessesary to change the data section use the rules:

  • 1.) Each definition of a field exists of two lines

  • 2.) The first line shows exactly the comment

  • '* data element: ' followed with the data element

  • which describes the field.

  • If you don't have a data element use the

  • comment without a data element name

  • 3.) The second line shows the fieldname of the

  • structure, the fieldname must consist of

  • a fieldname and optional the character '_' and

  • three numbers and the field length in brackets

  • 4.) Each field must be type C.

*

      • Generated data section with specific formatting - DO NOT CHANGE ***

data: begin of record,

  • data element: CO_KDAUF

KDAUF_001(010),

  • data element: CO_KDPOS

KDPOS_002(006),

  • data element: CO_MATNR

MATNR_003(018),

  • data element: WERKS_D

WERKS_004(004),

  • data element: CO_PWERK

PWERK_005(004),

  • data element: PP_AUFART

PP_AUFART_006(004),

  • data element: GAMNG

GAMNG_007(017),

  • data element: CO_GMEIN

GMEIN_008(003),

  • data element: TERMKZ

TERKZ_009(001),

  • data element: FHORI

FHORI_010(003),

  • data element: CO_GLTRP

GLTRP_011(010),

  • data element: GAMNG

GAMNG_012(017),

  • data element: CO_GMEIN

GMEIN_013(003),

  • data element: CO_GLTRP

GLTRP_014(010),

  • data element: CO_GSTRP

GSTRP_015(010),

  • data element: TERMKZ

TERKZ_016(001),

  • data element: FHORI

FHORI_017(003),

end of record.

      • End generated data section ***

start-of-selection.

perform open_dataset using dataset.

perform open_group.

do.

read dataset dataset into record.

if sy-subrc <> 0. exit. endif.

perform bdc_dynpro using 'SAPLCOKO1' '0220'.

perform bdc_field using 'BDC_CURSOR'

'AUFPAR-PP_AUFART'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'AFPOD-KDAUF'

record-KDAUF_001.

perform bdc_field using 'AFPOD-KDPOS'

record-KDPOS_002.

perform bdc_field using 'CAUFVD-MATNR'

record-MATNR_003.

perform bdc_field using 'CAUFVD-WERKS'

record-WERKS_004.

perform bdc_field using 'AFPOD-PWERK'

record-PWERK_005.

perform bdc_field using 'AUFPAR-PP_AUFART'

record-PP_AUFART_006.

perform bdc_dynpro using 'SAPLCOKO1' '0115'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'BDC_CURSOR'

'CAUFVD-GAMNG'.

perform bdc_field using 'CAUFVD-GAMNG'

record-GAMNG_007.

perform bdc_field using 'CAUFVD-GMEIN'

record-GMEIN_008.

perform bdc_field using 'CAUFVD-TERKZ'

record-TERKZ_009.

perform bdc_field using 'CAUFVD-FHORI'

record-FHORI_010.

perform bdc_field using 'CAUFVD-GLTRP'

record-GLTRP_011.

perform bdc_dynpro using 'SAPLCOKO1' '0115'.

perform bdc_field using 'BDC_OKCODE'

'=BU'.

perform bdc_field using 'BDC_CURSOR'

'CAUFVD-GAMNG'.

perform bdc_field using 'CAUFVD-GAMNG'

record-GAMNG_012.

perform bdc_field using 'CAUFVD-GMEIN'

record-GMEIN_013.

perform bdc_field using 'CAUFVD-GLTRP'

record-GLTRP_014.

perform bdc_field using 'CAUFVD-GSTRP'

record-GSTRP_015.

perform bdc_field using 'CAUFVD-TERKZ'

record-TERKZ_016.

perform bdc_field using 'CAUFVD-FHORI'

record-FHORI_017.

perform bdc_transaction using 'CO08'.

enddo.

perform close_group.

perform close_dataset using dataset.

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