Standard BDC program used for FI
hi all ,
i would like to know the standard BDC program used in FI , like for tcode fb01 or somethings else.
Appreciate for any segguestion.
thanks and regards.
hi siddu m
thanks for replay ,
i have anohter question
provided the transaction A was contianed in the first batch file,
and also contained in the second batch file , how the tcode treated as the duplicate posting ?
many thanks
Similar Messages
-
Issue with BDC program used for FBZ5 (Check Print)
Hi all,
I am having one requirement in Check printing. as per that i have made one Z program which will accept multiple Payment documents. I am passing selected accounting documents to BDC routine for Transaction FBZ5. (As in FBZ5 we can take a print for one Payment document not for multiple)
We can have 3 scenarios in FBZ5
1. Fresh Check printing (First time check printing)
2. Old Check (printing for same Check no)
3. New Check (After voiding older check)
Category 1 and 2 are working fine but i am facing problem in category 3.
For Category 3 : BDC Screen flow is like this
A. Tcode FBZ5 Start program: SAPMFCHK Screen: 750 --> Click on 'Print'
B. Program: SAPLSPO2 Screen: 0100 --> Here specify option 'New Check'
C. Program: SAPMFCHK Screen: 0700
- This program belongs to new Tcode FCH7
- Here we have to give Void Reason code
Now issue with Category 3:
While executing BDC in online and background mode my control is terminating at step C mentioned above
Troubleshooting:
I have debugged standard program of FBZ5
1. in Include MFCHKFD0 we can see call to Tcode FCH7 (PERFORM AUFRUF_FCH7.)
2. in form AUFRUF_FCH7 i found code related to BDC
also there one statement is getting triggered --> CALL TRANSACTION 'FCH7' USING BDC MODE 'A'.
So there is a BDC call inside my Z BDC program, so is this a reason why my program is not working for above scenario ?
Or can't we handle above scenario in a way mentioned above?Hi Sandra,
I was trying to upload customer master in fd01 using bdc. The screens were different while recording. So could not perform the upload. Thenone screen was skipped so that the bdc was working fine and the data was uploaded.
This is the flow of the recording.
'SAPMF02D' '0105'.
SAPMF02D' '7105'
SAPMF02D' '0111
SAPMF02D' '0120
SAPMF02D' '0130
SAPMF02D' '0210
SAPMF02D' '0215
SAPMF02D' '0220'
SAPMF02D' '0230'
SAPMF02D' '0610
After the second screen was deleted the bdc worked fine. -
The standard BDC program for FI
hi all ,
i would like to know the standard BDC program usd in FI , like for tcode fb01 or somethings else.
Appreciate for any segguestion.
thanks and regards.thanks
another question,
how the fb01 check a duplicated entry?
any materials about this , i have seen that somewhere but can't remember it
thansk -
BAPI or FM or Standard BDC program for Production version creation (C223)
Hi All,
Is there BAPI or FM or Standard BDC program for Production version creation? Please help me.
Thanks & Regards
SanthoshHi,
Try this FM "CO_OCM_CREATE_PROD_VERSION"
Regards,
Smart -
BDC programming using Batch input Session.
Hello Experts.
I'm an ABAP beginner. I've benn practicing BDC programming using Batch input Session
at the moment.
This is the program that upload Local file which has plural records, and put the records into a Session.
These are the records.
413459,KIM EI HWAN121 ,19810607,MIADONG1234
423459,KIM EI HWAN122 ,19810607,MIADONG1235
433459,KIM EI HWAN123 ,19810607,MIADONG1236
443459,KIM EI HWAN124 ,19810607,MIADONG1237
453459,KIM EI HWAN125 ,19810607,MIADONG1238
463459,KIM EI HWAN126 ,19810607,MIADONG1239
I succeeded making Session.
However, for some reaseon, every record in the Session has got the same, value which is the first record.
Why is this happening? And How can I correct the code below?
REPORT ZBCUSER002_BATCH NO STANDARD PAGE HEADING
LINE-SIZE 255
MESSAGE-ID ZBATCH.
= Types definition ===================================================
TYPES: BEGIN OF TYP_LOCAL, "For Local file upload
RECORD(200) TYPE C,
END OF TYP_LOCAL.
= Internal table definition ==============================================
DATA: BEGIN OF BDC_TAB OCCURS 0. "BDCDATA itab
INCLUDE STRUCTURE BDCDATA.
DATA: END OF BDC_TAB.
DATA: BEGIN OF MESSAGE_BDC OCCURS 0. "Message itab
INCLUDE STRUCTURE BDCMSGCOLL.
DATA: END OF MESSAGE_BDC.
DATA: TBL_LOCAL TYPE STANDARD TABLE OF TYP_LOCAL, "Local file itab
F_TBL TYPE FILETABLE. "FILETABLE fot local
= Structure table definition =========================================
DATA: STR_F_TBL LIKE LINE OF F_TBL, "FILETABLE structure
STR_LOCAL TYPE TYP_LOCAL. "Local file structure
= Variable definition ================================================
DATA: LV_RC TYPE I, "Method parameter
ENUMBER TYPE ZT601-ENUMBER, "Employee number
NAME TYPE ZT601-NAME, "Employee name
BIRTH TYPE ZT601-BIRTH, "Birthday
HOMETOWN TYPE ZT601-HOMETOWN, "Hometown
SYSVAL TYPE SY-SUBRC. "System valuible
= Constants definition ===============================================
CONSTANTS: TBL_NAME(10) TYPE C VALUE 'ZT601'. "Table name ZT601
= Parameters definition ==============================================
PARAMETERS: F_NAME TYPE RLGRAP-FILENAME OBLIGATORY, "File path
EXECMODE(1) TYPE C. "Execute mode
INITIALIZATION
*----- Initialize all valuables, structures and internal tables
CLEAR: LV_RC,
STR_F_TBL,
STR_LOCAL,
ENUMBER,
NAME,
BIRTH,
HOMETOWN.
REFRESH: F_TBL,
TBL_LOCAL.
AT SELECTION-SCREEN
*----- When the button next to Parameter 'F_NAME',
*----- File dialog open.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR F_NAME.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
EXPORTING
WINDOW_TITLE = 'SELECT FILE'
DEFAULT_FILENAME = '*.TXT'
CHANGING
FILE_TABLE = F_TBL
RC = LV_RC
EXCEPTIONS
FILE_OPEN_DIALOG_FAILED = 1
CNTL_ERROR = 2
OTHERS = 3
*----- system valiable check.
*----- If done properly,
*----- Put the path into the File path parameter
IF SY-SUBRC = 0.
READ TABLE F_TBL INTO STR_F_TBL INDEX 1.
F_NAME = STR_F_TBL.
*----- If not done properly, show message
*----- An error occured while getting file path then end program
ELSE.
MESSAGE E000.
ENDIF.
*----- Execute code can only be A or N.
AT SELECTION-SCREEN ON EXECMODE.
IF EXECMODE <> 'A' AND EXECMODE <> 'N'.
MESSAGE E001.
ENDIF.
START-OF-SELECTION
START-OF-SELECTION.
*----- Upload Local file of file path parameter.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = F_NAME
FILETYPE = 'ASC'
TABLES
DATA_TAB = TBL_LOCAL
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
OTHERS = 6.
*----- System valiable check.
*----- If not done properly, show an error message
*----- An error occured while uploading local file then end program
IF SY-SUBRC <> 0.
MESSAGE E002.
ENDIF.
PERFORM BDC_OPEN.
*----- Loop Internal table
LOOP AT TBL_LOCAL INTO STR_LOCAL.
*----- Spilt the file record and put them into each valiable.
SPLIT STR_LOCAL AT ',' INTO ENUMBER
NAME
BIRTH
HOMETOWN.
*----- Data check Function module
CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
DATE = BIRTH
EXCEPTIONS
PLAUSIBILITY_CHECK_FAILED = 1
OTHERS = 2.
*----- When error occurs while checking date, show an error message.
*----- (&1) is not date
IF SY-SUBRC <> 0.
MESSAGE E003 WITH BIRTH.
ENDIF.
*-- The first screen of SE11
*----- Screen number 0102 of program id SAPMSRD0
PERFORM BDC_DYNPRO USING 'SAPMSRD0' '0102'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RSRD1-TBMA_VAL'. "Field on Cursor
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=SHOW'. "Display button
PERFORM BDC_FIELD USING 'RSRD1-TBMA'
'X'.
PERFORM BDC_FIELD USING 'RSRD1-TBMA_VAL'
TBL_NAME. "ZT601
*-- Table definition screen
*----- Screen number 2000 of program id SAPLSD02
PERFORM BDC_DYNPRO USING 'SAPLSD02' '2000'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'DD02D-TABCLTEXT'. "Field on Cursor
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TDED'. "Create entry
PERFORM BDC_FIELD USING 'BDC_SUBSCR'
'SAPLSD02'.
PERFORM BDC_FIELD USING 'BDC_SUBSCR'
'SAPLSED5'.
*-- Data input screen
*----- Screen number 0101 of program /1BCDWB/DBZT601
PERFORM BDC_DYNPRO USING '/1BCDWB/DBZT601' '0101'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ZT601-CRUSER'. "Field on Cursor
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=SAVE'. "Save
PERFORM BDC_FIELD USING 'ZT601-MANDT'
SY-MANDT. "Client
PERFORM BDC_FIELD USING 'ZT601-ENUMBER'
ENUMBER. "Employee number
PERFORM BDC_FIELD USING 'ZT601-NAME'
NAME. "Employee name
PERFORM BDC_FIELD USING 'ZT601-BIRTH'
BIRTH. "Birthday
PERFORM BDC_FIELD USING 'ZT601-HOMETOWN'
HOMETOWN. "Hometown
PERFORM BDC_FIELD USING 'ZT601-CRDATE'
SY-DATUM. "System date
PERFORM BDC_FIELD USING 'ZT601-CRTIME'
SY-UZEIT. "System time
PERFORM BDC_FIELD USING 'ZT601-CRUSER'
SY-UNAME. "System user
*-- Data input screen (After input)
*----- Screen number 0101 of program /1BCDWB/DBZT601
PERFORM BDC_DYNPRO USING '/1BCDWB/DBZT601' '0101'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/EBACK'. "Back
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ZT601-CRUSER'. "Field on Cursor
*-- Table definition screen]
*----- Screen number 2000 of program SAPLSD02
PERFORM BDC_DYNPRO USING 'SAPLSD02' '2000'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'DD02D-TABCLTEXT'. "Field on Cursor
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=WB_BACK'. "Back
*-- The first screen of SE11
*----- Screen number 0102 of program SAPMSRD0
PERFORM BDC_DYNPRO USING 'SAPMSRD0' '0102'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RSRD1-TBMA_VAL'. "Field on Cursor
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BACK'.
PERFORM BDC_FIELD USING 'RSRD1-TBMA'
'X'.
PERFORM BDC_FIELD USING 'RSRD1-TBMA_VAL'
TBL_NAME.
PERFORM BDC_INSERT.
ENDLOOP.
PERFORM BDC_CLOSE.
FORM BDC_DYNPRO *
Put Program-Id, Dynpro screen number, Start point
into DBCDATA
--> PROGRAM *
--> DYNPRO *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDC_TAB.
BDC_TAB-PROGRAM = PROGRAM.
BDC_TAB-DYNPRO = DYNPRO.
BDC_TAB-DYNBEGIN = 'X'.
APPEND BDC_TAB.
ENDFORM.
FORM BDC_FIELD *
Put Field Name and Value into BDCDATA
--> FNAM *
--> FVAL *
FORM BDC_FIELD USING FNAM FVAL.
CLEAR BDC_TAB.
BDC_TAB-FNAM = FNAM.
BDC_TAB-FVAL = FVAL.
APPEND BDC_TAB.
ENDFORM.
FORM bdc_process *
FORM BDC_OPEN.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = 'Testsession'
KEEP = 'X'
USER = SY-UNAME.
IF SY-SUBRC <> 0.
MESSAGE E006 WITH SY-SUBRC.
ENDIF.
ENDFORM.
FORM bdc_insert *
FORM BDC_INSERT.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'SE11'
TABLES
DYNPROTAB = BDC_TAB
EXCEPTIONS
INTERNAL_ERROR = 1
NOT_OPEN = 2
QUEUE_ERROR = 3
TCODE_INVALID = 4
PRINTING_INVALID = 5
POSTING_INVALID = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
MESSAGE E007 WITH SY-SUBRC.
ENDIF.
CLEAR: BDC_TAB.
ENDFORM.
FORM bdc_close *
FORM BDC_CLOSE.
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE E008 WITH SY-SUBRC.
ENDIF.
ENDFORM.God I forgot to refresh Internal table after putting record into Session.
Now I'm done.
You guys be careful too. -
Hi,
I am new to HR ABAP . Can anybody send me an end to end sample BDC program using HR ABAP. I have a requirement to develop a program.
Please give the sample file which has the sample data to upload to SAP.
Rgds,
Sofiahi....
to create a program of your own....
goto tcode 'SHDB' and there go for a new recording of the TCODE as required by you...
after recording is complete there is a button to GENERATE a program for that
i am looking for a complete data tranfer example which i have done.... i ll send that to you
regards
this is a sample code for it
THIS IS WRITTEN BY ME,YOU CAN GENERATE PROGRAM DIRECTLY
*" Type declarations...................................................
Type declaration of the structure to hold material information *
TYPES:
BEGIN OF type_s_mat,
name(10) TYPE c, " Material Number
industry TYPE c, " Industry Sector
mtype(10) TYPE c, " Material Type
descr(20) TYPE c, " Material Description
unit(10) TYPE c, " Base Unit of Measure
END OF type_s_mat,
type_s_f2(4096) TYPE c.
*" Data declarations...................................................
Work variables *
DATA:
fs_f1 TYPE type_s_mat, " Field string of TYPE_S_MAT
fs_workarea TYPE bdcdata, " Field string of type BDCDATA
fs_bdc TYPE bdcmsgcoll, " Field string of type bdcmsgcoll
w_msg(72) TYPE c, " Holds message for writing
w_i TYPE i, " Holds value of rc
w_file TYPE filetable, " Holds name of the file
w_var TYPE file_table, " Field string of file_table
w_file1 TYPE string. " Holds the path of the file
Internal table to hold data for the input *
DATA:
t_itab LIKE
STANDARD TABLE
OF fs_workarea,
Internal table to hold data for the messages *
t_mess LIKE
STANDARD TABLE
OF fs_bdc,
t_mat LIKE
STANDARD TABLE
OF fs_f1,
Internal table to hold data for the input *
t_temp TYPE
STANDARD TABLE
OF type_s_f2.
*"Selection screen elements............................................
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: p_file(128) TYPE c.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST EVENT *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'FILE_OPEN'
default_extension = 'XLS'
CHANGING
file_table = w_file
rc = w_i
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. " IF SY-SUBRC <> 0.
LOOP AT w_file INTO w_var.
p_file = w_var-filename.
ENDLOOP. " LOOP AT W_FILE INTO W_VAR.
ULINE.
START-OF-SELECTION EVENT *
START-OF-SELECTION.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_tab_raw_data = t_temp
i_filename = p_file
TABLES
i_tab_converted_data = t_mat
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. " IF SY-SUBRC EQ 0.
END-OF-SELECTION EVENT *
END-OF-SELECTION.
PERFORM sub_display.
*& Form sub_screen
This subroutine appends the value of screen name and number *
-->PV_screenam This holds screen name *
-->PV_scrnum This holds screen number *
FORM sub_screen USING value(pv_screenam)
value(pv_scrnum).
CLEAR fs_workarea.
fs_workarea-program = pv_screenam.
fs_workarea-dynpro = pv_scrnum.
fs_workarea-dynbegin = 'X'.
APPEND fs_workarea TO t_itab.
ENDFORM. " FORM SUB_SCREEN
*& Form SUB_FIELD_DATA *
This subroutine apppends field name and value of the screen. *
-->PV_FLDNAM This holds field name *
-->PV_FLDVAL This holds Field value *
FORM sub_field_data USING value(pv_fldnam)
value(pv_fldval).
CLEAR fs_workarea.
fs_workarea-fnam = pv_fldnam.
fs_workarea-fval = pv_fldval.
APPEND fs_workarea TO t_itab.
ENDFORM. " FORM SUB_FIELD_DATA
*& Form sub_display *
This subroutine fills the value on screen fields when BDC executes *
There are no interface parameters to be passed to this subroutine. *
FORM sub_display .
LOOP AT t_mat INTO fs_f1.
CLEAR fs_workarea.
CLEAR fs_bdc.
PERFORM sub_screen USING 'SAPLMGMM' '0060'.
PERFORM sub_field_data USING 'RMMG1-MATNR' fs_f1-name.
PERFORM sub_field_data USING 'RMMG1-MBRSH' fs_f1-industry.
PERFORM sub_field_data USING 'RMMG1-MTART' fs_f1-mtype.
PERFORM sub_field_data USING 'BDC_OKCODE' '/00'.
PERFORM sub_screen USING 'SAPLMGMM' '0070'.
PERFORM sub_field_data USING 'MSICHTAUSW-KZSEL(01)' 'X'.
PERFORM sub_field_data USING 'MSICHTAUSW-KZSEL(02)' 'X'.
PERFORM sub_field_data USING 'BDC_OKCODE' '=ENTR'.
PERFORM sub_screen USING 'SAPLMGMM' '4004'.
PERFORM sub_field_data USING 'MAKT-MAKTX' fs_f1-descr.
PERFORM sub_field_data USING 'MARA-MEINS' fs_f1-unit.
PERFORM sub_field_data USING 'BDC_OKCODE' '/00'.
PERFORM sub_screen USING 'SAPLMGMM' '4004'.
PERFORM sub_field_data USING 'BDC_OKCODE' '=BU'.
CALL TRANSACTION 'MM01' USING t_itab MODE 'A' MESSAGES INTO t_mess.
ENDLOOP.
ENDFORM. " SUB_DISPLAY
Edited by: Mohit Kumar on Feb 18, 2009 12:40 PM -
SD Flow program using For all entries.
using simple ALV grid: I have the urgent requirement of changing the following program using 'For all entries' instead of joins and I should not use 'TABLES' -- For top-of-page I need to get dynamic fields like if I select company code in the selection screen then I need to get 'This report is base on COMPANY CODE'.
This program is about sales flow where i shud get only those records that have ebeln in vbak, delivery, invoice.
The original program is as follows:
*& Report ZSD_DOCU_FLOW *
REPORT zsd_docu_flow NO STANDARD PAGE HEADING .
* Program : ZCOS_SALES *
* Dev. Class : ZSD
* Functional :
* Created on : *
* Project :
* CR Number :
* Transaction : ZSDCSUT *
* Description : * Sales document life cylce for given customer
* to declaired period displaying the sales document
* details ,with relevant del details and corresponding
* Invocie Details
*----------- Tables Declaration -----------*
TABLES: vbak,vbap,vbfa,kna1,vbrk,vbrp,likp,lips,t001.
TYPE-POOLS : slis.
*----------- Internal Tables Declaration -----------*
* Internal Table for Sales Order data *
DATA: BEGIN OF it_so OCCURS 0,
vbeln LIKE vbak-vbeln,
kunnr LIKE vbak-kunnr,
posnr LIKE vbap-posnr,
matnr LIKE vbap-matnr,
kwmeng LIKE vbap-kwmeng,
netwr LIKE vbap-netwr,
END OF it_so.
* Internal Table for Delivery Order data *
DATA: BEGIN OF it_del OCCURS 0,
delnum LIKE likp-vbeln,
lfdat LIKE likp-lfdat,
delitem LIKE lips-posnr,
lfimg LIKE lips-lfimg,
END OF it_del.
* Internal Table for Invoice data *
DATA: BEGIN OF it_inv OCCURS 0,
invnum LIKE vbrk-vbeln,
invitem LIKE vbrp-posnr,
fkimg LIKE vbrp-fkimg,
amount LIKE vbrp-netwr,
END OF it_inv.
* Internal Table for Final data *
DATA: BEGIN OF it_final OCCURS 0,
vbeln LIKE vbak-vbeln,
posnr LIKE vbap-posnr,
kunnr LIKE vbak-kunnr,
name LIKE kna1-name1,
matnr LIKE vbap-matnr,
kwmeng LIKE vbap-kwmeng,
netwr LIKE vbap-netwr,
delnum LIKE likp-vbeln,
lfdat LIKE likp-lfdat,
delitem LIKE lips-posnr,
lfimg LIKE lips-lfimg,
invnum LIKE vbrk-vbeln,
invitem LIKE vbrp-posnr,
fkimg LIKE vbrp-fkimg,
amount LIKE vbrp-netwr,
END OF it_final.
*----------- Variables Declaration -----------*
DATA: v_name LIKE kna1-kunnr," variable for customer name
v_delnum LIKE likp-vbeln," variable for delivery number
v_invnum LIKE vbrk-vbeln." variable for invoce number
DATA : ls_layout TYPE slis_layout_alv,
it_fcat TYPE slis_t_fieldcat_alv ,
wa_fcat TYPE slis_fieldcat_alv,
lh TYPE slis_t_listheader,
ls TYPE slis_listheader,
it_events TYPE slis_t_event ,
ls_event TYPE slis_alv_event ,
i_sort TYPE slis_t_sortinfo_alv,
w_var TYPE i.
DATA : l_date(10).
DATA : l_date1(20).
DATA : l_repid LIKE trdir-name.
l_repid = 'ZSD_DOCU_FLOW1'.
*----------- Select-options & parameters Declaration ---*
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_bukrs LIKE vbak-bukrs_vf,
p_vkorg LIKE vbak-vkorg,
p_vtweg LIKE vbak-vtweg,
p_spart LIKE vbak-spart.
SELECT-OPTIONS: s_kunnr FOR vbak-kunnr,
s_audat FOR vbak-audat.
SELECTION-SCREEN END OF BLOCK b1.
*----------- AT SELECTION-SCREEN --------------------------*
AT SELECTION-SCREEN.
SELECT SINGLE * FROM t001 INTO t001
WHERE bukrs = p_bukrs.
IF sy-subrc <> 0.
MESSAGE e000(8i) WITH 'Enter a Valid Company Code'.
ENDIF.
SELECT SINGLE * FROM vbak INTO vbak
WHERE vkorg = p_vkorg.
IF sy-subrc <> 0.
MESSAGE e000(8i) WITH 'Enter a Valid Sales Organization'.
ENDIF.
SELECT SINGLE * FROM vbak INTO vbak
WHERE vtweg = p_vtweg.
IF sy-subrc <> 0.
MESSAGE e000(8i) WITH 'Enter a Valid distribution channel'.
ENDIF.
SELECT SINGLE * FROM vbak INTO vbak
WHERE spart = p_spart.
IF sy-subrc <> 0.
MESSAGE e000(8i) WITH 'Enter a Valid Division'.
ENDIF.
SELECT SINGLE * FROM kna1 INTO kna1
WHERE kunnr IN s_kunnr.
IF sy-subrc <> 0.
MESSAGE e000(8i) WITH 'Enter a Valid Customer Number'.
ENDIF.
*----------- START-OF-SELECTION-----------------------------*
START-OF-SELECTION.
ls-typ = 'H'.
ls-info = 'Sales Document Flow'.
APPEND ls TO lh.
ls-typ = 'S'.
WRITE: sy-datum TO l_date USING EDIT MASK '__/__/____'.
CONCATENATE 'DATE :' l_date INTO l_date1 SEPARATED BY space.
ls-info = l_date1.
APPEND ls TO lh.
PERFORM field_cat.
PERFORM t_sort_build USING i_sort.
PERFORM get-data.
*----------- END-OF-SELECTION-----------------------------*
END-OF-SELECTION.
IF it_final[] IS INITIAL.
MESSAGE i000(8i) WITH 'No data Found'.
EXIT.
ENDIF.
PERFORM print-data.
*& Form get-data
* text
* --> p1 text
* <-- p2 text
FORM get-data .
* Accesing Sales Data
SELECT a~vbeln a~kunnr b~posnr b~matnr b~kwmeng b~netwr
INTO CORRESPONDING FIELDS OF TABLE it_so
FROM vbak AS a INNER JOIN vbap AS b
ON a~vbeln = b~vbeln
WHERE a~bukrs_vf = p_bukrs
AND a~vkorg = p_vkorg
AND a~vtweg = p_vtweg
AND a~spart = p_spart
AND a~kunnr IN s_kunnr
AND a~audat IN s_audat.
LOOP AT it_so.
SELECT SINGLE name1 FROM kna1 INTO v_name
WHERE kunnr = it_so-kunnr.
SELECT SINGLE vbeln FROM vbfa INTO v_delnum
WHERE vbelv = it_so-vbeln
AND vbtyp_n = 'J'.
IF sy-subrc = 0.
SELECT SINGLE vbeln FROM vbfa INTO v_invnum
WHERE vbelv = v_delnum
AND vbtyp_n = 'M'.
ENDIF.
MOVE-CORRESPONDING it_so TO it_final.
it_final-name = v_name.
it_final-delnum = v_delnum.
it_final-invnum = v_invnum.
APPEND it_final.
CLEAR it_final.
CLEAR v_delnum.
CLEAR v_invnum.
ENDLOOP.
LOOP AT it_final.
IF it_final-delnum NE ' '.
* Reading Del Data.
SELECT SINGLE a~vbeln a~lfdat b~posnr b~lfimg INTO
(it_del-delnum, it_del-lfdat, it_del-delitem,
it_del-lfimg ) FROM
likp AS a INNER JOIN lips AS b ON a~vbeln = b~vbeln
WHERE a~vbeln = it_final-delnum
AND b~posnr = it_final-posnr.
MOVE-CORRESPONDING it_del TO it_final.
MODIFY it_final.
ENDIF.
IF it_final-invnum NE ' '.
* Reading Invoice Data.
SELECT SINGLE vbeln posnr fkimg netwr INTO
(it_inv-invnum, it_inv-invitem, it_inv-fkimg, it_inv-amount )
FROM vbrp WHERE vbeln = it_final-invnum
AND posnr = it_final-posnr.
MOVE-CORRESPONDING it_inv TO it_final.
MODIFY it_final.
ENDIF.
ENDLOOP.
ENDFORM. " get-data
*& Form print-data
* text
* --> p1 text
* <-- p2 text
FORM print-data .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = l_repid
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
i_callback_top_of_page = 'TOP'
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
* IS_LAYOUT =
it_fieldcat = it_fcat
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
IT_SORT = i_sort[]
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* I_HTML_HEIGHT_TOP =
* I_HTML_HEIGHT_END =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_final.
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
* IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* ENDIF.
ENDFORM. " print-data
*& Form field_cat
* text
* --> p1 text
* <-- p2 text
FORM field_cat .
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_FINAL'.
wa_fcat-fieldname = 'VBELN'.
wa_fcat-key = 'X'.
wa_fcat-ref_fieldname = 'VBELN'.
wa_fcat-ref_tabname = 'VBAK'.
wa_fcat-seltext_m = 'Sales Order NO'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_FINAL'.
wa_fcat-fieldname = 'POSNR'.
wa_fcat-ref_fieldname = 'POSNR'.
wa_fcat-ref_tabname = 'VBAP'.
wa_fcat-seltext_m = 'SalesItemNO'.
wa_fcat-fix_column = 'X'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_FINAL'.
wa_fcat-fieldname = 'KUNNR'.
wa_fcat-seltext_m = 'CUSTNUM'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_FINAL'.
wa_fcat-fieldname = 'NAME'.
wa_fcat-seltext_m = 'CUSTNAME'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_FINAL'.
wa_fcat-fieldname = 'MATNR'.
wa_fcat-seltext_m = 'MATNUM'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_FINAL'.
wa_fcat-fieldname = 'KWMENG'.
wa_fcat-seltext_m = 'Sales Quantity'.
wa_fcat-do_sum = 'X'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_FINAL'.
wa_fcat-fieldname = 'NETWR'.
wa_fcat-seltext_m = 'Value'.
wa_fcat-do_sum = 'X'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_FINAL'.
wa_fcat-fieldname = 'DELNUM'.
wa_fcat-seltext_m = 'DeloveryNum'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_FINAL'.
wa_fcat-fieldname = 'DELITEM'.
wa_fcat-seltext_m = 'DelItemNO'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_FINAL'.
wa_fcat-fieldname = 'LFDAT'.
wa_fcat-seltext_m = 'DelDate'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_FINAL'.
wa_fcat-fieldname = 'LFIMG'.
wa_fcat-seltext_m = 'DelQuantity'.
wa_fcat-do_sum = 'X'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_FINAL'.
wa_fcat-fieldname = 'INVNUM'.
wa_fcat-seltext_m = 'InvoiceNum'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_FINAL'.
wa_fcat-fieldname = 'INVITEM'.
wa_fcat-seltext_m = 'InvoiceItem'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_FINAL'.
wa_fcat-fieldname = 'FKIMG'.
wa_fcat-seltext_m = 'INVQuantity'.
wa_fcat-do_sum = 'X'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_FINAL'.
wa_fcat-fieldname = 'AMOUNT'.
wa_fcat-seltext_m = 'INVvalue'.
wa_fcat-do_sum = 'X'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
ENDFORM. " field_cat
*& Form top
* text
FORM t_sort_build USING l_sort TYPE slis_t_sortinfo_alv.
DATA: ls_sort TYPE slis_sortinfo_alv.
ls_sort-fieldname = 'VBELN'.
ls_sort-spos = 1.
ls_sort-up = 'X'.
ls_sort-subtot = 'X'.
APPEND ls_sort TO l_sort.
ls_sort-fieldname = 'KUNNR'.
ls_sort-spos = 2.
ls_sort-up = 'X'.
APPEND ls_sort TO l_sort.
ENDFORM. "t_sort_bui
FORM top.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = lh
* I_LOGO =
* I_END_OF_LIST_GRID =
ENDFORM. "TOP
===========================================================================
I have started the new program but i have trouble with the final internal table. Since i'm using For all entries I have declared internal tables for each table. My incomplete new program is as follows(not sure if the logic is correct till what I have coded):
*& Report Z_SDFLOW *
REPORT Z_SDFLOW NO STANDARD PAGE HEADING.
********* TABLES TO BE USED ***********************
**** VBAK - SALES DOCUMENT HEADER
* VBAP - SALES ITEM
* VBFA - SALES DOCUMENT FLOW
* KNA1- CUSTOMER MASTER
* VBRK - BILLING DOCUMENT HEADER
* VBRP - BLLING DOCUMENT ITEM
* LIKP - DELIVERY HEADER
* LIPS - DELIVERY ITEM
* TOO1 - COMPANY CODES
* SLIS.
TYPE-POOLS: SLIS.
** STRUCTURE DECLARATIONS ********
**STRUCTURE FOR ENQUIRY.
**STRUCTURE FOR QUOTATION.
**STRUCTURE FOR SALES ORDER HEADER- VBAK.
TYPES: BEGIN OF XT_VBAK,
VBELN TYPE VBAK-VBELN, "SALES DOCUMENT NUMBER
KUNNR TYPE VBAK-KUNNR, " SOLD-TO-PARTY
END OF XT_VBAK.
**STRUCTURE FOR SALES ORDER ITEM-VBAP
TYPES: BEGIN OF XT_VBAP,
POSNR TYPE VBAP-POSNR, " SALES ITEM NUMBER
MATNR TYPE VBAP-MATNR, " MATERIAL NUMBER
KWMENG TYPE VBAP-KWMENG, " CUMMULATIVE ORDER QUANTITY IN SALES UNITS
NETWR TYPE VBAP-NETWR, " NET VALUE OF THE ORDER ITEM
END OF XT_VBAP.
** STRUCTURE FOR DELIVERY HEADER -LIKP
TYPES: BEGIN OF XT_LIKP,
DELVBELN TYPE LIKP-VBELN, "DELIVERY DOCUMENT NUMBER
LFDAT TYPE LIKP-LFDAT, " DELIVERY DATE
END OF XT_LIKP.
**STRUCTURE FOR DELIVERY ITEM - LIPS
TYPES: BEGIN OF XT_LIPS,
DELPOSNR TYPE LIPS-POSNR, " DELIVERY ITEM NUMBER
LFIMG TYPE LIPS-LFIMG, " ACTUAL QUANTITY DELIVERED
END OF XT_LIPS.
**STRUCTURE FOR BILLING DOCUMENT HEADER -VBRK
TYPES: BEGIN OF XT_VBRK,
INVVBELN TYPE VBRK-VBELN, "BILLING DOCUMENT NUMBER
END OF XT_VBRK.
**STRUCTURE FOR BILLING DOCUMENT ITEM - VBRP
TYPES: BEGIN OF XT_VBRP,
INVPOSNR TYPE VBRP-POSNR, "BILLING ITEM NUMBER
FKIMG TYPE VBRP-FKIMG, "ACTUAL INVOICED QUANTITY
INVNETWR TYPE VBRP-NETWR, "NET VALUE OF THE BILLING ITEM
END OF XT_VBRP.
**STRUCTURE FOR FINAL INTERNAL TABLE.
TYPES: BEGIN OF XT_FINAL,
VBELN TYPE VBAK-VBELN,
DELVBELN TYPE LIKP-VBELN,
INVBELN TYPE VBRK-VBELN,
KUNNR TYPE VBAK-KUNNR,
POSNR TYPE VBAP-POSNR,
DELPOSNT TYPE LIPS-POSNR,
INVPOSNR TYPE VBRP-POSNR,
MATNR TYPE VBAP-MATNR,
KWMENG TYPE VBAP-KWMENG,
NETWR TYPE VBAP-NETWR,
INVNETWR TYPE VBRP-NETWR,
LFDAT TYPE LIKP-LFDAT,
LFIMG TYPE LIPS-LFIMG,
FKIMG TYPE VBRP-FKIMG,
NAME1 TYPE KNA1-NAME1,
END OF XT_FINAL.
**DATA DECLARATIONS
DATA: V_NAME1 TYPE KNA1-NAME1, "#EC *
V_DELVBELN TYPE LIKP-VBELN,
V_INVVBELN TYPE VBRK-VBELN,
V_BUKRS TYPE T001-BUKRS, "COMPANY CODE "#EC *
V_AUDAT TYPE VBAK-AUDAT,
V_VKORG TYPE VBAK-VKORG,
V_VKGRP TYPE VBAK-VKGRP,
V_SPART TYPE VBAK-SPART.
**INTERNAL TABLE DECLARATIONS
DATA: IT_VBAK TYPE STANDARD TABLE OF XT_VBAK,
WA_VBAK TYPE XT_VBAK,
IT_VBAP TYPE STANDARD TABLE OF XT_VBAP,
WA_VBAP TYPE XT_VBAP,
IT_LIKP TYPE STANDARD TABLE OF XT_LIKP,
WA_LIKP TYPE XT_LIKP,
IT_LIPS TYPE STANDARD TABLE OF XT_LIPS,
WA_LIPS TYPE XT_LIPS,
IT_VBRK TYPE STANDARD TABLE OF XT_VBRK,
WA_VBRK TYPE XT_VBRK,
IT_VBRP TYPE STANDARD TABLE OF XT_VBRP,
WA_VBRP TYPE XT_VBRP,
IT_FINAL TYPE STANDARD TABLE OF XT_FINAL,
WA_FINAL TYPE XT_FINAL.
**ALV DECLARATIONS
DATA: IT_FLDCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FLDCAT TYPE SLIS_FIELDCAT_ALV,
IT_LSTHDR TYPE SLIS_T_LISTHEADER,
WA_LSTHDR TYPE SLIS_LISTHEADER,
IT_EVENTS TYPE SLIS_T_EVENT,
WA_EVENTS TYPE SLIS_ALV_EVENT,
IT_SORT TYPE SLIS_T_SORTINFO_ALV,
IT_LAYOUT TYPE SLIS_LAYOUT_ALV.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: S_BUKRS FOR V_BUKRS NO INTERVALS NO-EXTENSION,
S_VBELN FOR WA_VBAK-VBELN, "SALES DOCUMENT NUMBER
S_KUNNR FOR WA_VBAK-KUNNR, "SOLD-TO-PARTY
S_AUDAT FOR V_AUDAT, "SALES DOCUMENT DATE
S_VKORG FOR V_VKORG, "SALES ORGANISATION
S_VKGRP FOR V_VKGRP, "SALES GROUP
S_SPART FOR V_SPART. "DIVISION
SELECTION-SCREEN END OF BLOCK b1.
*****************SCREEN VALIDATION***************
AT SELECTION-SCREEN.
SELECT SINGLE BUKRS FROM T001 INTO V_BUKRS WHERE BUKRS IN S_BUKRS."#EC *
IF SY-SUBRC <> 0.
MESSAGE E000(Z_SD2) WITH 'ENTER A VALID COMPANY CODE'.
ENDIF.
SELECT SINGLE VBELN FROM VBAK INTO
CORRESPONDING FIELDS OF WA_VBAK WHERE VBELN IN S_VBELN.
IF SY-SUBRC <> 0.
MESSAGE E000(Z_SD2) WITH 'ENTER VALID SALES DOCUMENT NUMBER'.
ENDIF.
SELECT SINGLE KUNNR FROM VBAK INTO
CORRESPONDING FIELDS OF WA_VBAK WHERE KUNNR IN S_KUNNR. "EC *
IF SY-SUBRC <> 0.
MESSAGE E000(Z_SD2) WITH 'ENTER A VALID CUSTOMER NUMBER'.
ENDIF.
SELECT SINGLE AUDAT FROM VBAK INTO V_AUDAT WHERE AUDAT IN S_AUDAT."#EC *
IF SY-SUBRC <> 0.
MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES DOCUMENT DATE'.
ENDIF.
SELECT SINGLE VKORG FROM VBAK INTO V_VKORG WHERE VKORG IN S_VKORG."#EC *
IF SY-SUBRC <> 0.
MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES ORGANISATION'.
ENDIF.
SELECT SINGLE VKGRP FROM VBAK INTO V_VKGRP WHERE VKGRP IN S_VKGRP."#EC *
IF SY-SUBRC <> 0.
MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES GROUP'.
ENDIF.
SELECT SINGLE SPART FROM VBAK INTO V_SPART WHERE SPART IN S_SPART."#EC *
IF SY-SUBRC <> 0.
MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES DIVISION'.
ENDIF.
PERFORM GET_DATA.
*& Form GET_DATA
FORM GET_DATA .
SELECT VBELN KUNNR
INTO TABLE IT_VBAK
FROM VBAK
WHERE VBELN IN S_VBELN.
* BUKRS_VF IN S_BUKRS AND
* VKORG IN S_VKORG AND
* VKGRP IN S_VKGRP AND
* SPART IN S_SPART AND
* KUNNR IN S_KUNNR AND
* AUDAT IN S_AUDAT.
IF IT_VBAK[] IS NOT INITIAL.
SELECT POSNR MATNR KWMENG NETWR
INTO TABLE IT_VBAP
FROM VBAP
FOR ALL ENTRIES IN IT_VBAK
WHERE VBELN = IT_VBAK-VBELN.
ENDIF.
IF IT_VBAK[] IS NOT INITIAL.
SELECT VBELN LFDAT
INTO TABLE IT_LIKP
FROM LIKP
FOR ALL ENTRIES IN IT_VBAK
WHERE VBELN = IT_VBAK-VBELN.
ENDIF.
IF IT_VBAP[] IS NOT INITIAL.
SELECT POSNR LFIMG
INTO TABLE IT_LIPS
FROM LIPS
FOR ALL ENTRIES IN IT_VBAP
WHERE POSNR = IT_VBAP-POSNR.
ENDIF.
IF IT_LIKP[] IS NOT INITIAL.
SELECT VBELN
INTO TABLE IT_VBRK
FROM VBRK
FOR ALL ENTRIES IN IT_LIKP
WHERE VBELN = IT_LIKP-DELVBELN.
ENDIF.
IF IT_LIPS[] IS NOT INITIAL.
SELECT POSNR FKIMG NETWR
INTO TABLE IT_VBRP
FROM VBRP
FOR ALL ENTRIES IN IT_LIPS
WHERE POSNR = IT_LIPS-DELPOSNR.
ENDIF.
ENDFORM. " GET_DATA
Edited by: srk s on Jan 29, 2008 7:33 PM
Edited by: Alvaro Tejada Galindo on Jan 29, 2008 9:49 AMHi Satish,
I have started the new program but i have trouble with the final internal table. Since i'm using For all entries, I have declared internal tables for each table. My incomplete new program is as follows(not sure if the logic is correct till what I have coded):
*& Report Z_SDFLOW *
REPORT Z_SDFLOW NO STANDARD PAGE HEADING.
********* TABLES TO BE USED ***********************
**** VBAK - SALES DOCUMENT HEADER
* VBAP - SALES ITEM
* VBFA - SALES DOCUMENT FLOW
* KNA1- CUSTOMER MASTER
* VBRK - BILLING DOCUMENT HEADER
* VBRP - BLLING DOCUMENT ITEM
* LIKP - DELIVERY HEADER
* LIPS - DELIVERY ITEM
* TOO1 - COMPANY CODES
* SLIS.
TYPE-POOLS: SLIS.
** STRUCTURE DECLARATIONS ********
**STRUCTURE FOR ENQUIRY.
**STRUCTURE FOR QUOTATION.
**STRUCTURE FOR SALES ORDER HEADER- VBAK.
TYPES: BEGIN OF XT_VBAK,
VBELN TYPE VBAK-VBELN, "SALES DOCUMENT NUMBER
KUNNR TYPE VBAK-KUNNR, " SOLD-TO-PARTY
END OF XT_VBAK.
**STRUCTURE FOR SALES ORDER ITEM-VBAP
TYPES: BEGIN OF XT_VBAP,
POSNR TYPE VBAP-POSNR, " SALES ITEM NUMBER
MATNR TYPE VBAP-MATNR, " MATERIAL NUMBER
KWMENG TYPE VBAP-KWMENG, " CUMMULATIVE ORDER QUANTITY IN SALES UNITS
NETWR TYPE VBAP-NETWR, " NET VALUE OF THE ORDER ITEM
END OF XT_VBAP.
** STRUCTURE FOR DELIVERY HEADER -LIKP
TYPES: BEGIN OF XT_LIKP,
DELVBELN TYPE LIKP-VBELN, "DELIVERY DOCUMENT NUMBER
LFDAT TYPE LIKP-LFDAT, " DELIVERY DATE
END OF XT_LIKP.
**STRUCTURE FOR DELIVERY ITEM - LIPS
TYPES: BEGIN OF XT_LIPS,
DELPOSNR TYPE LIPS-POSNR, " DELIVERY ITEM NUMBER
LFIMG TYPE LIPS-LFIMG, " ACTUAL QUANTITY DELIVERED
END OF XT_LIPS.
**STRUCTURE FOR BILLING DOCUMENT HEADER -VBRK
TYPES: BEGIN OF XT_VBRK,
INVVBELN TYPE VBRK-VBELN, "BILLING DOCUMENT NUMBER
END OF XT_VBRK.
**STRUCTURE FOR BILLING DOCUMENT ITEM - VBRP
TYPES: BEGIN OF XT_VBRP,
INVPOSNR TYPE VBRP-POSNR, "BILLING ITEM NUMBER
FKIMG TYPE VBRP-FKIMG, "ACTUAL INVOICED QUANTITY
INVNETWR TYPE VBRP-NETWR, "NET VALUE OF THE BILLING ITEM
END OF XT_VBRP.
**STRUCTURE FOR FINAL INTERNAL TABLE.
TYPES: BEGIN OF XT_FINAL,
VBELN TYPE VBAK-VBELN,
DELVBELN TYPE LIKP-VBELN,
INVBELN TYPE VBRK-VBELN,
KUNNR TYPE VBAK-KUNNR,
POSNR TYPE VBAP-POSNR,
DELPOSNT TYPE LIPS-POSNR,
INVPOSNR TYPE VBRP-POSNR,
MATNR TYPE VBAP-MATNR,
KWMENG TYPE VBAP-KWMENG,
NETWR TYPE VBAP-NETWR,
INVNETWR TYPE VBRP-NETWR,
LFDAT TYPE LIKP-LFDAT,
LFIMG TYPE LIPS-LFIMG,
FKIMG TYPE VBRP-FKIMG,
NAME1 TYPE KNA1-NAME1,
END OF XT_FINAL.
**DATA DECLARATIONS
DATA: V_NAME1 TYPE KNA1-NAME1, "#EC *
V_DELVBELN TYPE LIKP-VBELN,
V_INVVBELN TYPE VBRK-VBELN,
V_BUKRS TYPE T001-BUKRS, "COMPANY CODE "#EC *
V_AUDAT TYPE VBAK-AUDAT,
V_VKORG TYPE VBAK-VKORG,
V_VKGRP TYPE VBAK-VKGRP,
V_SPART TYPE VBAK-SPART.
**INTERNAL TABLE DECLARATIONS
DATA: IT_VBAK TYPE STANDARD TABLE OF XT_VBAK,
WA_VBAK TYPE XT_VBAK,
IT_VBAP TYPE STANDARD TABLE OF XT_VBAP,
WA_VBAP TYPE XT_VBAP,
IT_LIKP TYPE STANDARD TABLE OF XT_LIKP,
WA_LIKP TYPE XT_LIKP,
IT_LIPS TYPE STANDARD TABLE OF XT_LIPS,
WA_LIPS TYPE XT_LIPS,
IT_VBRK TYPE STANDARD TABLE OF XT_VBRK,
WA_VBRK TYPE XT_VBRK,
IT_VBRP TYPE STANDARD TABLE OF XT_VBRP,
WA_VBRP TYPE XT_VBRP,
IT_FINAL TYPE STANDARD TABLE OF XT_FINAL,
WA_FINAL TYPE XT_FINAL.
**ALV DECLARATIONS
DATA: IT_FLDCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FLDCAT TYPE SLIS_FIELDCAT_ALV,
IT_LSTHDR TYPE SLIS_T_LISTHEADER,
WA_LSTHDR TYPE SLIS_LISTHEADER,
IT_EVENTS TYPE SLIS_T_EVENT,
WA_EVENTS TYPE SLIS_ALV_EVENT,
IT_SORT TYPE SLIS_T_SORTINFO_ALV,
IT_LAYOUT TYPE SLIS_LAYOUT_ALV.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: S_BUKRS FOR V_BUKRS NO INTERVALS NO-EXTENSION,
S_VBELN FOR WA_VBAK-VBELN, "SALES DOCUMENT NUMBER
S_KUNNR FOR WA_VBAK-KUNNR, "SOLD-TO-PARTY
S_AUDAT FOR V_AUDAT, "SALES DOCUMENT DATE
S_VKORG FOR V_VKORG, "SALES ORGANISATION
S_VKGRP FOR V_VKGRP, "SALES GROUP
S_SPART FOR V_SPART. "DIVISION
SELECTION-SCREEN END OF BLOCK b1.
*****************SCREEN VALIDATION***************
AT SELECTION-SCREEN.
SELECT SINGLE BUKRS FROM T001 INTO V_BUKRS WHERE BUKRS IN S_BUKRS."#EC *
IF SY-SUBRC <> 0.
MESSAGE E000(Z_SD2) WITH 'ENTER A VALID COMPANY CODE'.
ENDIF.
SELECT SINGLE VBELN FROM VBAK INTO
CORRESPONDING FIELDS OF WA_VBAK WHERE VBELN IN S_VBELN.
IF SY-SUBRC <> 0.
MESSAGE E000(Z_SD2) WITH 'ENTER VALID SALES DOCUMENT NUMBER'.
ENDIF.
SELECT SINGLE KUNNR FROM VBAK INTO
CORRESPONDING FIELDS OF WA_VBAK WHERE KUNNR IN S_KUNNR. "EC *
IF SY-SUBRC <> 0.
MESSAGE E000(Z_SD2) WITH 'ENTER A VALID CUSTOMER NUMBER'.
ENDIF.
SELECT SINGLE AUDAT FROM VBAK INTO V_AUDAT WHERE AUDAT IN S_AUDAT."#EC *
IF SY-SUBRC <> 0.
MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES DOCUMENT DATE'.
ENDIF.
SELECT SINGLE VKORG FROM VBAK INTO V_VKORG WHERE VKORG IN S_VKORG."#EC *
IF SY-SUBRC <> 0.
MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES ORGANISATION'.
ENDIF.
SELECT SINGLE VKGRP FROM VBAK INTO V_VKGRP WHERE VKGRP IN S_VKGRP."#EC *
IF SY-SUBRC <> 0.
MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES GROUP'.
ENDIF.
SELECT SINGLE SPART FROM VBAK INTO V_SPART WHERE SPART IN S_SPART."#EC *
IF SY-SUBRC <> 0.
MESSAGE E000(Z_SD2) WITH 'ENTER A VALID SALES DIVISION'.
ENDIF.
PERFORM GET_DATA.
*& Form GET_DATA
FORM GET_DATA .
SELECT VBELN KUNNR
INTO TABLE IT_VBAK
FROM VBAK
WHERE VBELN IN S_VBELN.
* BUKRS_VF IN S_BUKRS AND
* VKORG IN S_VKORG AND
* VKGRP IN S_VKGRP AND
* SPART IN S_SPART AND
* KUNNR IN S_KUNNR AND
* AUDAT IN S_AUDAT.
IF IT_VBAK[] IS NOT INITIAL.
SELECT POSNR MATNR KWMENG NETWR
INTO TABLE IT_VBAP
FROM VBAP
FOR ALL ENTRIES IN IT_VBAK
WHERE VBELN = IT_VBAK-VBELN.
ENDIF.
IF IT_VBAK[] IS NOT INITIAL.
SELECT VBELN LFDAT
INTO TABLE IT_LIKP
FROM LIKP
FOR ALL ENTRIES IN IT_VBAK
WHERE VBELN = IT_VBAK-VBELN.
ENDIF.
IF IT_VBAP[] IS NOT INITIAL.
SELECT POSNR LFIMG
INTO TABLE IT_LIPS
FROM LIPS
FOR ALL ENTRIES IN IT_VBAP
WHERE POSNR = IT_VBAP-POSNR.
ENDIF.
IF IT_LIKP[] IS NOT INITIAL.
SELECT VBELN
INTO TABLE IT_VBRK
FROM VBRK
FOR ALL ENTRIES IN IT_LIKP
WHERE VBELN = IT_LIKP-DELVBELN.
ENDIF.
IF IT_LIPS[] IS NOT INITIAL.
SELECT POSNR FKIMG NETWR
INTO TABLE IT_VBRP
FROM VBRP
FOR ALL ENTRIES IN IT_LIPS
WHERE POSNR = IT_LIPS-DELPOSNR.
ENDIF.
ENDFORM. " GET_DATA
Code Formatted by: Alvaro Tejada Galindo on Jan 29, 2008 9:48 AM -
Standard smartform name and standard print program name for Sales Quotation
Hi,
I would like to know the standard smartform name and standard print program name which can be used for sales quotation through transaction VA23.
For eg: The standard output type for billing document (For T code VF03) is RD00 and it' smartform name is LB_BIL_INVOICE. It's print program name is RLB_INVOICE.
Similarly, I would like to know the standard smartform name and standard print program name for AN00 output type which is used for sales quotation. .
Regards,
ZahidHello
std driver prgram is /SMB40/RVADOR01
form entry is ENTRY
std smartforms is /SMB40/SDQUO_A an du can check this the in NACE tcode.
Output Type AN00 Quotation
Application V1 Sales
Program /SMB40/RVADOR01
Form Routine ENTRY
Form RVORDER01
PDF/Smartform Form /SMB40/SDQUO_A
Thank u,
santhosh -
Standard Condition type used for Manual freight at item level
Hello Gurus
Can you please tell me the standard condition type used for entering freight manually at header as well as item level.
Warm Regards
Prashant Joshi.Prashanth,
The freight Conditions that we use in Sales are two types
HD00 - Header Level, wherein we have no access sequence
KF00 - Item level, Wherein we have access sequence KF00 - Freight
But you want the condition types to be maintained manually, then you need item details screen of the respective condition type HD00/KF00 using Tcode V/06.
Inside that Manual entry as "C". Similarly you need to maintain or activate "Manual" Indicator in pricing procedure. Then you can enter the freight Manually.
Note:
The difference In applying at the header level and item level is if you enter freight value at the header level it is applicable to all items in the item level. But if you want to apply freight we can give freight to each item or selective item.
Regards
Sathya -
Hi pls give names of some standard BDC program
thank you
raviBDC allows you to perform database updates in the background using standard SAP transactions.
The resultant entries will be as if the user had manually entered the data via SAP. This means
that you do not bypass any of the standard SAP consistency checks, authorisations etc.
There are two main methods of ABAP BDC, these are Call Transaction and Batch Input.
Other methods of update include Direct update, Idoc and BAPI.
e
Example program : 1
Report ZBDC_EXAMPLE *
*& Example BDC program, which updates net price of item 00010 of a *
*& particular Purchase order(EBELN). *
REPORT ZBDC_EXAMPLE NO STANDARD PAGE HEADING
LINE-SIZE 132.
* Data declaration
TABLES: ekko, ekpo.
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekko-ebeln,
waers TYPE ekko-waers,
netpr TYPE ekpo-netpr,
err_msg(73) TYPE c,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko,
it_error TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_error TYPE t_ekko,
it_success TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_success TYPE t_ekko.
DATA: w_textout LIKE t100-text.
DATA: gd_update TYPE i,
gd_lines TYPE i.
*Used to store BDC data
DATA: BEGIN OF bdc_tab OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA: END OF bdc_tab.
*Used to stores error information from CALL TRANSACTION Function Module
DATA: BEGIN OF messtab OCCURS 0.
INCLUDE STRUCTURE bdcmsgcoll.
DATA: END OF messtab.
*Screen declaration
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME
TITLE text-001. "Purchase order Num
SELECT-OPTIONS: so_ebeln FOR ekko-ebeln OBLIGATORY.
SELECTION-SCREEN END OF BLOCK block1.
SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME
TITLE text-002. "New NETPR value
PARAMETERS: p_newpr(14) TYPE c obligatory. "LIKE ekpo-netpr.
SELECTION-SCREEN END OF BLOCK block2.
*START-OF-SELECTION
START-OF-SELECTION.
* Retrieve data from Purchase order table(EKKO)
SELECT ekko~ebeln ekko~waers ekpo~netpr
INTO TABLE it_ekko
FROM ekko AS ekko INNER JOIN ekpo AS ekpo
ON ekpo~ebeln EQ ekko~ebeln
WHERE ekko~ebeln IN so_ebeln AND
ekpo~ebelp EQ '10'.
*END-OF-SELECTION
END-OF-SELECTION.
* Check data has been retrieved ready for processing
DESCRIBE TABLE it_ekko LINES gd_lines.
IF gd_lines LE 0.
* Display message if no data has been retrieved
MESSAGE i003(zp) WITH 'No Records Found'(001).
LEAVE TO SCREEN 0.
ELSE.
* Update Customer master data (instalment text)
LOOP AT it_ekko INTO wa_ekko.
PERFORM bdc_update.
ENDLOOP.
* Display message confirming number of records updated
IF gd_update GT 1.
MESSAGE i003(zp) WITH gd_update 'Records updated'(002).
ELSE.
MESSAGE i003(zp) WITH gd_update 'Record updated'(003).
ENDIF.
* Display Success Report
* Check Success table
DESCRIBE TABLE it_success LINES gd_lines.
IF gd_lines GT 0.
* Display result report column headings
PERFORM display_column_headings.
* Display result report
PERFORM display_report.
ENDIF.
* Display Error Report
* Check errors table
DESCRIBE TABLE it_error LINES gd_lines.
* If errors exist then display errors report
IF gd_lines GT 0.
* Display errors report
PERFORM display_error_headings.
PERFORM display_error_report.
ENDIF.
ENDIF.
*& Form DISPLAY_COLUMN_HEADINGS
* Display column headings
FORM display_column_headings.
WRITE:2 ' Success Report '(014) COLOR COL_POSITIVE.
SKIP.
WRITE:2 'The following records updated successfully:'(013).
WRITE:/ sy-uline(42).
FORMAT COLOR COL_HEADING.
WRITE:/ sy-vline,
(10) 'Purchase Order'(004), sy-vline,
(11) 'Old Netpr'(005), sy-vline,
(11) 'New Netpr'(006), sy-vline.
WRITE:/ sy-uline(42).
ENDFORM. " DISPLAY_COLUMN_HEADINGS
*& Form BDC_UPDATE
* Populate BDC table and call transaction ME22
FORM bdc_update.
PERFORM dynpro USING:
'X' 'SAPMM06E' '0105',
' ' 'BDC_CURSOR' 'RM06E-BSTNR',
' ' 'RM06E-BSTNR' wa_ekko-ebeln,
' ' 'BDC_OKCODE' '/00', "OK code
'X' 'SAPMM06E' '0120',
' ' 'BDC_CURSOR' 'EKPO-NETPR(01)',
' ' 'EKPO-NETPR(01)' p_newpr,
' ' 'BDC_OKCODE' '=BU'. "OK code
* Call transaction to update customer instalment text
CALL TRANSACTION 'ME22' USING bdc_tab MODE 'N' UPDATE 'S'
MESSAGES INTO messtab.
* Check if update was succesful
IF sy-subrc EQ 0.
ADD 1 TO gd_update.
APPEND wa_ekko TO it_success.
ELSE.
* Retrieve error messages displayed during BDC update
LOOP AT messtab WHERE msgtyp = 'E'.
* Builds actual message based on info returned from Call transaction
CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
msgid = messtab-msgid
msgnr = messtab-msgnr
msgv1 = messtab-msgv1
msgv2 = messtab-msgv2
msgv3 = messtab-msgv3
msgv4 = messtab-msgv4
IMPORTING
message_text_output = w_textout.
ENDLOOP.
* Build error table ready for output
wa_error = wa_ekko.
wa_error-err_msg = w_textout.
APPEND wa_error TO it_error.
CLEAR: wa_error.
ENDIF.
* Clear bdc date table
CLEAR: bdc_tab.
REFRESH: bdc_tab.
ENDFORM. " BDC_UPDATE
* FORM DYNPRO *
* stores values to bdc table *
* --> DYNBEGIN *
* --> NAME *
* --> VALUE *
FORM dynpro USING dynbegin name value.
IF dynbegin = 'X'.
CLEAR bdc_tab.
MOVE: name TO bdc_tab-program,
value TO bdc_tab-dynpro,
'X' TO bdc_tab-dynbegin.
APPEND bdc_tab.
ELSE.
CLEAR bdc_tab.
MOVE: name TO bdc_tab-fnam,
value TO bdc_tab-fval.
APPEND bdc_tab.
ENDIF.
ENDFORM. " DYNPRO
*& Form DISPLAY_REPORT
* Display Report
FORM display_report.
FORMAT COLOR COL_NORMAL.
* Loop at data table
LOOP AT it_success INTO wa_success.
WRITE:/ sy-vline,
(10) wa_success-ebeln, sy-vline,
(11) wa_success-netpr CURRENCY wa_success-waers, sy-vline,
(11) p_newpr, sy-vline.
CLEAR: wa_success.
ENDLOOP.
WRITE:/ sy-uline(42).
REFRESH: it_success.
FORMAT COLOR COL_BACKGROUND.
ENDFORM. " DISPLAY_REPORT
*& Form DISPLAY_ERROR_REPORT
* Display error report data
FORM display_error_report.
LOOP AT it_error INTO wa_error.
WRITE:/ sy-vline,
(10) wa_error-ebeln, sy-vline,
(11) wa_error-netpr CURRENCY wa_error-waers, sy-vline,
(73) wa_error-err_msg, sy-vline.
ENDLOOP.
WRITE:/ sy-uline(104).
REFRESH: it_error.
ENDFORM. " DISPLAY_ERROR_REPORT
*& Form DISPLAY_ERROR_HEADINGS
* Display error report headings
FORM display_error_headings.
SKIP.
WRITE:2 ' Error Report '(007) COLOR COL_NEGATIVE.
SKIP.
WRITE:2 'The following records failed during update:'(008).
WRITE:/ sy-uline(104).
FORMAT COLOR COL_HEADING.
WRITE:/ sy-vline,
(10) 'Purchase Order'(009), sy-vline,
(11) 'Netpr'(010), sy-vline,
(73) 'Error Message'(012), sy-vline.
WRITE:/ sy-uline(104).
FORMAT COLOR COL_NORMAL.
ENDFORM. " DISPLAY_ERROR_HEADINGS
Example : 2
Goto transaction SHBD enter a recording name and specify the transaction code.
Enter the test data and save it , it will actomatically create a bdc program.
now select that recording name and click create program icon and specify the program name.
This is the program which was created using transaction SHDB for XD01.
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: KUN16
KUNNR_001(016),
* data element: BUKRS
BUKRS_002(004),
* data element: VKORG
VKORG_003(004),
* data element: VTWEG
VTWEG_004(002),
* data element: SPART
SPART_005(002),
* data element: KTOKD
KTOKD_006(004),
* data element: ANRED
ANRED_007(015),
* data element: NAME1_GP
NAME1_008(035),
* data element: SORTL
SORTL_009(010),
* data element: NAME2_GP
NAME2_010(035),
* data element: STRAS_GP
STRAS_011(035),
* data element: PFACH
PFACH_012(010),
* data element: ORT01_GP
ORT01_013(035),
* data element: PSTLZ
PSTLZ_014(010),
* data element: ORT02_GP
ORT02_015(035),
* data element: PFORT_GP
PFORT_016(035),
* data element: PSTL2
PSTL2_017(010),
* data element: LAND1_GP
LAND1_018(003),
* data element: REGIO
REGIO_019(003),
* data element: SPRAS
SPRAS_020(002),
* data element: TELX1
TELX1_021(030),
* data element: TELF1
TELF1_022(016),
* data element: TELFX
TELFX_023(031),
* data element: TELF2
TELF2_024(016),
* data element: TELTX
TELTX_025(030),
* data element: TELBX
TELBX_026(015),
* data element: URL
KNURL_027(132),
* data element: STCD1
STCD1_028(016),
* data element: STCD2
STCD2_029(011),
* data element: BBBNR
BBBNR_030(007),
* data element: BBSNR
BBSNR_031(005),
* data element: BUBKZ
BUBKZ_032(001),
* data element: BRSCH
BRSCH_033(004),
* data element: LZONE
LZONE_034(010),
* data element: KUKLA
KUKLA_035(002),
* data element: BRSCH
BRSCH_036(004),
* data element: UMSA1
UMSA1_037(020),
* data element: UWAER
UWAER_038(005),
* data element: UMJAH
UMJAH_039(004),
* data element: JMZAH
JMZAH_040(006),
* data element: JMJAH
JMJAH_041(004),
* data element: BANKS
BANKS_01_042(003),
* data element: BANKK
BANKL_01_043(015),
* data element: BANKN
BANKN_01_044(018),
* data element: ABLAD
ABLAD_01_045(025),
* data element: KNKAL
KNFAK_01_046(002),
* data element: CIVVE
CIVVE_047(001),
* data element: ANRED_AP
ANRED_01_048(030),
* data element: ANRED_AP
ANRED_02_049(030),
* data element: NAMEV_VP
NAMEV_01_050(035),
* data element: NAMEV_VP
NAMEV_02_051(035),
* data element: NAME1_GP
NAME1_01_052(035),
* data element: NAME1_GP
NAME1_02_053(035),
* data element: TELF1
TELF1_01_054(016),
* data element: TELF1
TELF1_02_055(016),
* data element: ABTNR_PA
ABTNR_01_056(004),
* data element: ABTNR_PA
ABTNR_02_057(004),
* data element: AKONT
AKONT_058(010),
* data element: DZTERM
ZTERM_059(004),
* data element: MAHNA
MAHNA_060(004),
* data element: BZIRK
BZIRK_061(006),
* data element: AWAHR
AWAHR_062(003),
* data element: WAERS_V02D
WAERS_063(005),
* data element: KALKS
KALKS_064(001),
* data element: LPRIO
LPRIO_065(002),
* data element: KZAZU_D
KZAZU_066(001),
* data element: ANTLF
ANTLF_067(001),
* data element: PERFK
PERFK_068(002),
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 'SAPMF02D' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RF02D-KTOKD'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02D-KUNNR'
record-KUNNR_001.
perform bdc_field using 'RF02D-BUKRS'
record-BUKRS_002.
perform bdc_field using 'RF02D-VKORG'
record-VKORG_003.
perform bdc_field using 'RF02D-VTWEG'
record-VTWEG_004.
perform bdc_field using 'RF02D-SPART'
record-SPART_005.
perform bdc_field using 'RF02D-KTOKD'
record-KTOKD_006.
perform bdc_dynpro using 'SAPMF02D' '0110'.
perform bdc_field using 'BDC_CURSOR'
'KNA1-KNURL'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KNA1-ANRED'
record-ANRED_007.
perform bdc_field using 'KNA1-NAME1'
record-NAME1_008.
perform bdc_field using 'KNA1-SORTL'
record-SORTL_009.
perform bdc_field using 'KNA1-NAME2'
record-NAME2_010.
perform bdc_field using 'KNA1-STRAS'
record-STRAS_011.
perform bdc_field using 'KNA1-PFACH'
record-PFACH_012.
perform bdc_field using 'KNA1-ORT01'
record-ORT01_013.
perform bdc_field using 'KNA1-PSTLZ'
record-PSTLZ_014.
perform bdc_field using 'KNA1-ORT02'
record-ORT02_015.
perform bdc_field using 'KNA1-PFORT'
record-PFORT_016.
perform bdc_field using 'KNA1-PSTL2'
record-PSTL2_017.
perform bdc_field using 'KNA1-LAND1'
record-LAND1_018.
perform bdc_field using 'KNA1-REGIO'
record-REGIO_019.
perform bdc_field using 'KNA1-SPRAS'
record-SPRAS_020.
perform bdc_field using 'KNA1-TELX1'
record-TELX1_021.
perform bdc_field using 'KNA1-TELF1'
record-TELF1_022.
perform bdc_field using 'KNA1-TELFX'
record-TELFX_023.
perform bdc_field using 'KNA1-TELF2'
record-TELF2_024.
perform bdc_field using 'KNA1-TELTX'
record-TELTX_025.
perform bdc_field using 'KNA1-TELBX'
record-TELBX_026.
perform bdc_field using 'KNA1-KNURL'
record-KNURL_027.
perform bdc_dynpro using 'SAPMF02D' '0120'.
perform bdc_field using 'BDC_CURSOR'
'KNA1-LZONE'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KNA1-STCD1'
record-STCD1_028.
perform bdc_field using 'KNA1-STCD2'
record-STCD2_029.
perform bdc_field using 'KNA1-BBBNR'
record-BBBNR_030.
perform bdc_field using 'KNA1-BBSNR'
record-BBSNR_031.
perform bdc_field using 'KNA1-BUBKZ'
record-BUBKZ_032.
perform bdc_field using 'KNA1-BRSCH'
record-BRSCH_033.
perform bdc_field using 'KNA1-LZONE'
record-LZONE_034.
perform bdc_dynpro using 'SAPMF02D' '0125'.
perform bdc_field using 'BDC_CURSOR'
'KNA1-JMJAH'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KNA1-KUKLA'
record-KUKLA_035.
perform bdc_field using 'KNA1-BRSCH'
record-BRSCH_036.
perform bdc_field using 'KNA1-UMSA1'
record-UMSA1_037.
perform bdc_field using 'KNA1-UWAER'
record-UWAER_038.
perform bdc_field using 'KNA1-UMJAH'
record-UMJAH_039.
perform bdc_field using 'KNA1-JMZAH'
record-JMZAH_040.
perform bdc_field using 'KNA1-JMJAH'
record-JMJAH_041.
perform bdc_dynpro using 'SAPMF02D' '0130'.
perform bdc_field using 'BDC_CURSOR'
'KNBK-BANKN(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'KNBK-BANKS(01)'
record-BANKS_01_042.
perform bdc_field using 'KNBK-BANKL(01)'
record-BANKL_01_043.
perform bdc_field using 'KNBK-BANKN(01)'
record-BANKN_01_044.
perform bdc_dynpro using 'SAPMF02D' '0130'.
perform bdc_field using 'BDC_CURSOR'
'KNBK-BANKS(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPMF02D' '0340'.
perform bdc_field using 'BDC_CURSOR'
'KNVA-KNFAK(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'KNVA-ABLAD(01)'
record-ABLAD_01_045.
perform bdc_field using 'KNVA-KNFAK(01)'
record-KNFAK_01_046.
perform bdc_dynpro using 'SAPMF02D' '0340'.
perform bdc_field using 'BDC_CURSOR'
'RF02D-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPMF02D' '0370'.
perform bdc_field using 'BDC_CURSOR'
'KNA1-CIVVE'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'KNA1-CIVVE'
record-CIVVE_047.
perform bdc_dynpro using 'SAPMF02D' '0360'.
perform bdc_field using 'BDC_CURSOR'
'KNVK-ABTNR(02)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'KNVK-ANRED(01)'
record-ANRED_01_048.
perform bdc_field using 'KNVK-ANRED(02)'
record-ANRED_02_049.
perform bdc_field using 'KNVK-NAMEV(01)'
record-NAMEV_01_050.
perform bdc_field using 'KNVK-NAMEV(02)'
record-NAMEV_02_051.
perform bdc_field using 'KNVK-NAME1(01)'
record-NAME1_01_052.
perform bdc_field using 'KNVK-NAME1(02)'
record-NAME1_02_053.
perform bdc_field using 'KNVK-TELF1(01)'
record-TELF1_01_054.
perform bdc_field using 'KNVK-TELF1(02)'
record-TELF1_02_055.
perform bdc_field using 'KNVK-ABTNR(01)'
record-ABTNR_01_056.
perform bdc_field using 'KNVK-ABTNR(02)'
record-ABTNR_02_057.
perform bdc_dynpro using 'SAPMF02D' '0360'.
perform bdc_field using 'BDC_CURSOR'
'KNVK-NAMEV(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPMF02D' '0210'.
perform bdc_field using 'BDC_CURSOR'
'KNB1-AKONT'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KNB1-AKONT'
record-AKONT_058.
perform bdc_dynpro using 'SAPMF02D' '0215'.
perform bdc_field using 'BDC_CURSOR'
'KNB1-ZTERM'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KNB1-ZTERM'
record-ZTERM_059.
perform bdc_dynpro using 'SAPMF02D' '0220'.
perform bdc_field using 'BDC_CURSOR'
'KNB5-MAHNA'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KNB5-MAHNA'
record-MAHNA_060.
perform bdc_dynpro using 'SAPMF02D' '0230'.
perform bdc_field using 'BDC_CURSOR'
'KNB1-VRSNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02D' '0310'.
perform bdc_field using 'BDC_CURSOR'
'KNVV-WAERS'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KNVV-BZIRK'
record-BZIRK_061.
perform bdc_field using 'KNVV-AWAHR'
record-AWAHR_062.
perform bdc_field using 'KNVV-WAERS'
record-WAERS_063.
perform bdc_field using 'KNVV-KALKS'
record-KALKS_064.
perform bdc_dynpro using 'SAPMF02D' '0315'.
perform bdc_field using 'BDC_CURSOR'
'KNVV-LPRIO'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KNVV-LPRIO'
record-LPRIO_065.
perform bdc_field using 'KNVV-KZAZU'
record-KZAZU_066.
perform bdc_field using 'KNVV-ANTLF'
record-ANTLF_067.
perform bdc_dynpro using 'SAPMF02D' '0320'.
perform bdc_field using 'BDC_CURSOR'
'KNVV-PERFK'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'KNVV-PERFK'
record-PERFK_068.
perform bdc_dynpro using 'SAPMF02D' '1350'.
perform bdc_field using 'BDC_CURSOR'
'RF02D-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPMF02D' '0324'.
perform bdc_field using 'BDC_CURSOR'
'KNVP-PARVW(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_transaction using 'XD01'.
enddo.
perform close_group.
perform close_dataset using dataset.
gIRISH -
BDC programming error for FF67
Hi guys,
I am working on FF67 BDC programming. When I am uploading data from excel, allthe values are getting passed correctly, except in the second screen value-date field (here the date is dispalying as 02.12.2020, though I have given it as 02.12.2008) And also it is displaying an error message as field FEBMKA-KWBTR(1) IS NOT AN INPUT FIELD. Am using ECC 6.0
And in the output it is displaying like below
statement/list is being updated atthe moment
Field FEBMKA-VGMAN(1) is not an input field
Field FEBEP-VALUT(1) is not an input field
Field FEBMKA-KWBTR(1) is not an input field
Warning: Values entered are ignored
Statement/list saved.
waiting for your reply guys.............
Thank you in advance..
KiranHi Avinash,
Thanks for the reply. I didn't get you. How can I use 'write to' statement?
I have written the code as follows
CONCATENATE 'FEBMKA-VGMAN(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
itab-transaction.
CALL FUNCTION 'CONVERSION_EXIT_PDATE_INPUT'
EXPORTING
INPUT = itab-value_date
IMPORTING
OUTPUT = date.
CONCATENATE 'FEBEP-VALUT(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
date.
CONCATENATE 'FEBMKA-KWBTR(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
itab-amount.
CONCATENATE 'FEBMKK-CHECT_KF(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
itab-bank_refchqno.
So, where shall I use the '' write to'' statement.
please suggest me.
bye,
Kiran -
How to upload a multistructured file in BDC program using gui_upload?
I want to upload a multistructured file in BDC program...in which some structures are repeating for multiple records..how to do this..
BP_GEN_DATA FR0100270154 FR12345678902
BP_PAYMENT FR 0123456789 01234567890
BP_UNLOAD MARSEILLE X FR
BP_UNLOAD PARIS FR
Here BP_GEN_DATA is root structure and BP_UNLOAD is lower level structure which is repeatingResolved
-
Automatic payment program use for Customer doc's
I can understand how APP will pay off vendor docs automatically but i know its used for customer documents also... i can't understand the logic of using a payment program on Customer docs.>?? can any expert give me a reason why????
i know its used for making some payment notices or some sort of a list of customer's from whom payment is due.. is this correct... please clarify thanks
Secondly with dunning.. again, this is used to fig who owe's me money and for how long but is dunning used with Vendor's accounts as well, If yes, whats the logic and what doc are created for that. .thanksHi Benson,
Yes APP is used for customers as well. Suppose you have your customer had made you down payement and you are not able to deliver the goods for anty reason. In this case you have to pay your customer back. So you can use APP for that. This is only one of business conditions.
Yes in case of Vendors you can also do dunning. The reasons can be many. Like you have made a down payment to the vendor for particular rawmaterail but your vendor had not yet delivered the goods. So in that case you can dunn the vendor.
Hope it makes you clear.
Regards
Pratiksha
*Please assign points if helpful -
Hi
As RSEOUT00 is a report used for the edi outbound process, can some 1 help me and tell me which report to run for startinmg the inbound process?
I know the Function module EDI_DATA_INCOMING is used for the process,but its supposed to be automatically called by the Subsytem.
Which report are we supposed to run to start the inbound process?
People who have a concrete andwer(Name of the Report or detailed process knowledge need only reply,othrs please excuse)Hi,
For inbound process generally the file from legacy system comes in xml FORMAT to EDI subsystem now it will be converted to IDOC file format or an idoc format.
if u get in IDOC file format then u need to use WE16 tcode .Now u need to put ur IDOC file in the application server directory and in WE21 U need to create a file port and then in the inbound file tab need to specify the application server path where u stored the IDOC file.
Now go to WE16 and give the directory path as well the file port and execute ,u will see an idoc will be created and can get the datails in WE02/WE05 tcode.
if u straight away get in idoc format then u can test in WE19 tcode by using the message type radio button ,Give the control record information and data record information and then u need to specify the FM which actually triggers the idoc inWE57 and u need to give that name in WE19 .Now press on execute button u will find the creation of idoc.
For inbound process the only method we have is processcode method which is attached to a FM in we42 ,whcih trigggers the idoc.
please have a look at the below programs
RBDMANI2
RBDMANIN
Regards,
Nagaraj -
BDC program using call txn for txn cj40
Hi,
I am uploading data using bdc call txn method for txn cj40. In flat file I have 2 header field and 4 line items.So in line items last field is Qty [RK70L-MENGE].This field data is not uploading.Pls tell me where is the problem.
And in txn cj40 first field is project def, So user wants. That field should be blank.
Bcoz it is taking previous value.Pls tell me the suitable code for that.
Thanks & Regards,
Shiv KantSo in line items last field is Qty RK70L-MENGE//
->Use char format in ur flat file for the quantity field.
itab-menge(13) type c.
//And in txn cj40 first field is project def, So user wants. That field should be blank.
Bcoz it is taking previous value.Pls tell me the suitable code for that.
Dont know what u mean by taking previous value .. just check if ur refreshing bdcdata structure after every iteration / before the start of iteration itself in ur loop endloop .
loop ..
refresh i_bdcdata[]. " <----
perform
perform
perform
endloop.
Maybe you are looking for
-
How to create Hierarchies for a Dimension?
Hi, How to create Hierarchies for a Dimension in Multidimensional Models? Could you please suggest some document provides step by step instructions to create Multidimensional Model? Thanks M Thiyagarajan
-
Applescript: file.open("r") returns empty in jsx
Hey guys, i am having a bit of a scripting problem here. The big goal for me at the moment is creating a UI script to control aerender. To achieve getting feedback from the terminal about when an aerender process is completed, i let the terminal trig
-
How do you put a signature cell in a numbers spreadsheet?
How do you put a signature cell in a numbers spreadsheet?
-
FileSystemTree.expandChildrenOf and expandItem dont work very well. expandChildrenOf opens only first child level, then first and second after having closed it in between and so on. And expandItem dont open anything, if(bExpandAll){ if (fst.sele
-
Mac Mini won't boot up, just beeps once every 4 seconds. Is it dead?
Mac Mini died, now it won't boot up. It just sits and beeps at me once every four seconds with the power light flashing once every four seconds also. If i shut it off, can't get it to turn on again without unplugging it. also, no boot sound. Time for