cancel
Showing results for 
Search instead for 
Did you mean: 

BDC FLAT FILE

Former Member
0 Kudos

<b>BDC:</b>PLEASE TELL ME HOW DOES THE FLAT FILE COME FOR A BDC UPDATION.IS IT THE HEADER AND ITEM DETAILS COME IN A SINGLE LINE OR HEADER DETAILS FOLLOWED BY THE ITEM DETAILS.PLERASE SHOW ME A SAMPLE IF POSSIBLE AND ALSOE SAMPLE CODE USING CALL TRANSACTION METHOD.

<b>SALES:</b>: WHAT FIELDS ARE USED TO DESIGN A REPORT HAVING SALES OCCURED IN A MONTH.

<b>SALES JOURNAL:</b> WHAT IS A SALES JOURANL.WHAT FIELDS ARE USED IN THE REPORT DESIGNED TO PRODUCE A SALES JOURNAL.PLEASE REPLY ME WITH THE NECESSARY FIELDS AND THEIR TABLES.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Harish,

BDC : It depends on how you want to design your file, or how your source system is capable of giving it. There is no hard and fast rule. Your program should be in a position to understand the format and process it accordingly.

SALES and SALES JOURNAL:

These reports are customer specific. The fields change from customer to customer.

regards,

Ravi

Note : Please mark the helpful answers.

Answers (2)

Answers (2)

Former Member
0 Kudos

hi Harish,

This is how BDC updation is done using flat file ...

LOOP AT IT_FFCUST.

PERFORM POPULATEBDC USING :

'X' 'SAPMF02D' '0105',

' ' 'BDC_OKCODE' '/00' ,

' ' 'RF02D-KUNNR' <b>IT_FFCUST-KUNNR</b>,

' ' 'RF02D-BUKRS' <b>IT_FFCUST-BUKRS</b>,

' ' 'RF02D-KTOKD' <b>IT_FFCUST-KTOKD</b>,

'X' 'SAPMF02D' '0110' ,

' ' 'BDC_OKCODE' '/00',

' ' 'KNA1-ANRED' IT_FFCUST-ANRED,

' ' 'KNA1-NAME1' IT_FFCUST-NAME1,

' ' 'KNA1-SORTL' IT_FFCUST-SORTL,

' ' 'KNA1-STRAS' IT_FFCUST-STRAS,

' ' 'KNA1-ORT01' IT_FFCUST-ORT01,

' ' 'KNA1-PSTLZ' IT_FFCUST-PSTLZ,

' ' 'KNA1-LAND1' IT_FFCUST-LAND1,

' ' 'KNA1-SPRAS' IT_FFCUST-SPRAS,

'X' 'SAPMFO2D' '0120',

' ' 'BDC_OKCODE' '/00',

'X' 'SAPMF02D' '0125',

' ' 'BDC_OKCODE' '/00',

'X' 'SAPMF02D' '0130',

' ' 'BDC_OKCODE' '=ENTR',

'X' 'SAPMF02D' '0340',

' ' 'BDC_OKCODE' '=ENTR',

'X' 'SAPMF02D' '0360',

' ' 'BDC_OKCODE' '=ENTR',

'X' 'SAPMF02D' '0210',

' ' 'KNB1-AKONT' IT_FFCUST-AKONT,

' ' 'BDC_OKCODE' '/00',

'X' 'SAPMF02D' '0215',

' ' 'BDC_OKCODE' '/00',

'X' 'SAPMF02D' '0220',

' ' 'BDC_OKCODE' '/00',

'X' 'SAPMF02D' '0230',

' ' 'BDC_OKCODE' '=UPDA'.

*--Calling the transaction 'fd01'.

CALL TRANSACTION 'FD01' USING IT_CUSTBDC MODE 'N' UPDATE 'S'

MESSAGES INTO IT_CUSTMSG.

IF SY-SUBRC <> 0.

*--Populating the error records internal table.

IT_ERRCUST-KUNNR = IT_FFCUST-KUNNR.

APPEND IT_ERRCUST.

CLEAR IT_ERRCUST.

*--Opening a session if there is an error record.

IF V_FLAG1 = ' '.

PERFORM FORM_OPENSESSION.

V_FLAG1 = 'X'.

ENDIF.

*--Inserting the error records into already open session.

IF V_FLAG1 = 'X'.

PERFORM FORM_INSERT.

ENDIF.

*--Populating the Success records internal table.

ELSE.

IT_SUCCUST-KUNNR = IT_FFCUST-KUNNR.

APPEND IT_SUCCUST.

CLEAR IT_SUCCUST.

ENDIF.

*--Displaying the messages.

IF NOT IT_CUSTMSG[] IS INITIAL.

PERFORM FORM_FORMATMSG.

ENDIF.

*--Clearing the message and bdc tables.

CLEAR : IT_CUSTBDC[],IT_CUSTMSG[].

ENDLOOP.

*--Getting the total no of error records.

DESCRIBE TABLE IT_ERRCUST LINES V_ELINES.

*--Getting the total no of successful records.

DESCRIBE TABLE IT_SUCCUST LINES V_SLINES.

*--Closing the session only if it is open.

IF V_FLAG1 = 'X'.

PERFORM FORM_CLOSESESS.

ENDIF.

Regards,

Santosh

Former Member
0 Kudos

For BDC file upload, the file structure depends upon the user and functional consultant. We get file format from them and then program accordingly to load data. File can be placed in Application server or Presentation server. You can use OPEN DATASET command or use fm GUI_UPLOAD.

Here is a sample code for BDC CALL TRANSACTION process -

DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,

IT_BDCMSGCOLL LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.

REFRESH IT_BDCDATA.

PERFORM BDC_DYNPRO USING 'SAPMM07I' '0700'.

PERFORM BDC_FIELD USING 'IKPF-WERKS'

'1000'.

PERFORM BDC_FIELD USING 'IKPF-LGORT'

'0001'.

PERFORM BDC_DYNPRO USING 'SAPMM07I' '0731'.

PERFORM BDC_FIELD USING 'ISEG-MATNR'

'000004005556109166'.

PERFORM BDC_FIELD USING 'ISEG-ERFMG'

'12'.

CALL TRANSACTION 'MI09' USING IT_BDCDATA

MODE 'E'

UPDATE 'S'

MESSAGES INTO IT_BDCMSGCOLL.

FORM BDC_DYNPRO USING PROG SCR.

CLEAR IT_BDCDATA.

IT_BDCDATA-PROGRAM = PROG.

IT_BDCDATA-DYNPRO = SCR.

IT_BDCDATA-DYNBEGIN = 'X'.

APPEND IT_BDCDATA.

ENDFORM. "BDC_DYNPRO

FORM BDC_FIELD USING FNAM FVAL.

CLEAR IT_BDCDATA.

IT_BDCDATA-FNAM = FNAM.

IT_BDCDATA-FVAL = FVAL.

APPEND IT_BDCDATA.

ENDFORM. "BDC_FIELD

Message was edited by: Ashish Gundawar