Generic BDC for VK11
Hi
Can any one tell me how to create <b>Generic BDC for transaction VK11 (Creating condition records)</b>
My actual requirement is like we need to create <b>condition record</b> for every material with all the condition types exist for that material for different key combinations dynamically . <b>A condition record for every material is to be created for different condition types and different key combinations dynamically where material MATNR is a key field</b> for example i need to create a conditon record for condition type <b>ZPR0,ZPR1</b> etc dynamically for different key combinations.
can anyone of you point out a way to me?
Thanks in advance
Shivakumar
Hi
Can any one tell me how to create <b>Generic BDC for transaction VK11 (Creating condition records)</b>
My actual requirement is like we need to create <b>condition record</b> for every material with all the condition types exist for that material for different key combinations dynamically . <b>A condition record for every material is to be created for different condition types and different key combinations dynamically where material MATNR is a key field</b> for example i need to create a conditon record for condition type <b>ZPR0,ZPR1</b> etc dynamically for different key combinations.
can anyone of you point out a way to me?
Thanks in advance
Shivakumar
Similar Messages
-
Hi
Can any one tell me how to create <b>Generic BDC for transaction VK11 (Creating condition records)</b>
My actual requirement is like we need to create <b>condition record</b> for every material with all the condition types exist for that material for different key combinations . <b>A condition record for every material is to be created for different condition types and different key combinations where material MATNR is a key field .For example we need to create condition records dynamically for condition types ZPR0, ZCM0 etc.. for different key combinations where matnr is a key field .</b>
can anyone of you point out a way to me?
Thanks in advance
Shivakumarplease copy the program and use it
* Report to Upload the pricing condtion records for materials. *
* Program : ZSDR_PRICE_UPLOAD *
* Author : girish.
* Description: *
* This report Creat pricing condition records for materials *
* Tables Used : SELECT UPDATE INSERT DELETE *
* MVKE X *
* Input/Output Files: *
* Transactions called: *
* Includes: *
* Run Frequency - *
* Program History *
* Date Change No Change Request SAP Rel NSC Rel *
* Description *
* 4.6C *
REPORT zsdr_price_upload MESSAGE-ID zsdr_bdc_vk11 LINE-SIZE 150
LINE-COUNT 75 .
******Internal Table for Header Data.
TYPES : BEGIN OF type_header,
kschl LIKE konv-kschl,
vkorg LIKE vbak-vkorg,
vtweg LIKE komg-spart,
matnr LIKE mvke-matnr,
kbetr(11) TYPE c,
datab(10) TYPE c,
datbi(10) TYPE c,
END OF type_header.
****Internal Table for Item Level.
TYPES : BEGIN OF type_item,
kschl LIKE konv-kschl,
vkorg LIKE vbak-vkorg,
vtweg LIKE komg-spart,
matnr LIKE mvke-matnr,
kbetr(11) TYPE c,
datab(10) TYPE c,
datbi(10) TYPE c,
END OF type_item.
******Error Table For not found in MVKE.
TYPES : BEGIN OF type_error ,
kschl LIKE konv-kschl,
vkorg LIKE vbak-vkorg,
vtweg LIKE komg-spart,
matnr LIKE mvke-matnr,
kbetr LIKE konp-kbetr,
datab(10) TYPE c,
datbi(10) TYPE c,
text(100) TYPE c,
END OF type_error.
****For error Messages
TYPES : BEGIN OF type_mtab,
matnr LIKE mara-matnr,
msgtyp LIKE bdcmsgcoll-msgtyp,
msgid LIKE bdcmsgcoll-msgid,
msgnr LIKE bdcmsgcoll-msgnr,
text(100) TYPE c,
END OF type_mtab.
****Internal Table
TYPES: BEGIN OF type_mvke,
matnr LIKE mvke-matnr,
vkorg LIKE mvke-vkorg,
vtweg LIKE mvke-vtweg,
END OF type_mvke.
****Internal Table
TYPES : BEGIN OF type_tvkov,
vkorg LIKE tvkov-vkorg,
vtweg LIKE tvkov-vtweg,
END OF type_tvkov.
** Declaring Internal Tables
DATA : t_header TYPE STANDARD TABLE OF type_header,
t_item TYPE STANDARD TABLE OF type_item,
t_mvke TYPE STANDARD TABLE OF type_mvke,
t_tvkov TYPE STANDARD TABLE OF type_tvkov,
t_error TYPE STANDARD TABLE OF type_error,
t_mtab TYPE STANDARD TABLE OF type_mtab.
** Work Area Declaration.
DATA : wa_header LIKE LINE OF t_header,
wa_item LIKE LINE OF t_item,
wa_error LIKE LINE OF t_error,
wa_mtab LIKE LINE OF t_mtab,
wa_tvkov LIKE LINE OF t_tvkov,
wa_mvke LIKE LINE OF t_mvke.
**Rows for Table with Excel Data********
DATA: t_xls_file LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
***Constant.
DATA : c_params LIKE ctu_params.
DATA : c_ans(1) TYPE c.
DATA : v_count(4) TYPE c. " To show No.of records
DATA : bdctab LIKE bdcdata OCCURS 10 WITH HEADER LINE. " BDCDATA
DATA : tmess_mtab LIKE bdcmsgcoll OCCURS 10 WITH HEADER LINE.
** SELECTION SCREEN
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : p_fname LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN : END OF BLOCK b1.
* END OF SELECTION SCREEN.
DATA : repid LIKE sy-repid.
DATA : v_matnr(50) TYPE c, "used for line items
v_kbetr(50) TYPE c, "used for line items
v_dat1(50) TYPE c, "used for line items
v_dat(50) TYPE c. "used for line items
DATA : v_lindx(5) TYPE n ,"index counter for first 14 records.
v_lindx1(5) TYPE n VALUE '01', "index counter for 13 records.
v_item(5) TYPE c, "To increment the line index
v_pgedwn2 TYPE i . "For Pagedown Counter
DATA: v_currentrow TYPE i. "For Current Row
DATA v_bdc(50) TYPE c." Text to apper in Confrim POPUP Window.
************AT SELECTION-SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
PERFORM get_filename USING p_fname.
*************START-OF-SELECTION
START-OF-SELECTION.
******Values for Ctu_params to Transaction
c_params-defsize = 'X'.
c_params-dismode = 'N'.
c_params-updmode = 'S'.
******Refresh
PERFORM f_refresh.
*********To upload File.
PERFORM upload_file.
****User Confrimation only BDC will Process
IF c_ans = '1'.
** *** BDC Process.
PERFORM read_data.
ELSE.
FORMAT COLOR 3 INTENSIFIED .
WRITE:/ 'Selected not to Process the Upload'.
EXIT.
ENDIF.
******On completion of Process Refresh the Internal Table
REFRESH : t_xls_file,
t_header,
t_item,
t_mvke,
t_tvkov.
CLEAR : t_xls_file,
wa_header,
wa_item,
wa_mvke,
wa_tvkov.
***********Display Messages
WRITE : /01 'Status',19 'Status Text'.
WRITE AT 0(150) sy-uline.
LOOP AT t_mtab INTO wa_mtab.
WRITE :/01 wa_mtab-msgtyp,19 wa_mtab-text.
ENDLOOP.
SKIP 2.
SORT t_error BY matnr.
WRITE AT 0(150) sy-uline.
WRITE 'ERROR MESSAGES'.
WRITE AT 0(150) sy-uline.
WRITE :/01 'Material.No',20 'Status Text'.
WRITE AT 0(150) sy-uline.
LOOP AT t_error INTO wa_error WHERE matnr NE ' '.
WRITE:/01 wa_error-matnr,20 wa_error-text.
ENDLOOP.
*& Form get_filename
* text
* -->P_FILENAME text
FORM get_filename USING p_fname.
*****To read the file from Presentation Server
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = repid
dynpro_number ! ; = syst-dynnr
field_name = p_fname
* STATIC = ' '
mask = '*.XLS'
CHANGING
file_name = p_fname
EXCEPTIONS
mask_too_long = 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. " get_filename
*& Form upload_file
* text
* --> p1 text
* <-- p2 text
FORM upload_file.
DATA : frow VALUE 2 TYPE i,
fcol VALUE 1 TYPE i,
erow VALUE 10000 TYPE i,
ecol VALUE 7 TYPE i,
ecol1 VALUE 1 TYPE i,
c_col1 TYPE i VALUE '0001',
c_col2 TYPE i VALUE '0002',
c_col3 TYPE i VALUE '0003',
&nb! sp; c_col4 TYPE i VALUE '0004',
c_col5 TYPE i VALUE '0005',
c_col6 TYPE i VALUE '0006',
c_col7 TYPE i VALUE '0007'.
***FM used to UPLOAD data from Flat file
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_fname
i_begin_col = fcol
i_begin_row = frow
i_end_col = ecol
i_end_row = erow
TABLES
intern = t_xls_file
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE e000.
ENDIF.
****T_XLS_FILE is initial, stop the process & throw message
IF t_xls_file[] IS INITIAL.
FORMAT COLOR 6 ON INTENSIFIED ON.
WRITE:/ 'No Data Exists '.
FORMAT COLOR OFF INTENSIFIED OFF.
STOP.
ELSE.
* Sort table by rows and colums
SORT t_xls_file BY row col.
* Get first row retrieved
READ TABLE t_xls_file INDEX 1.
* Set first row retrieved to current row
v_currentrow = t_xls_file-row.
**Loop to move data in internal Table
LOOP AT t_xls_file .
* Reset values for next row
IF t_xls_file-row NE v_currentrow.
APPEND wa_header TO t_header.
CLEAR wa_header.
v_currentrow = t_xls_file-row.
ENDIF.
CASE t_xls_file-col.
WHEN c_col1. "Kschl
wa_header-kschl = t_xls_file-value.
WHEN c_col2. "Vkorg
wa_header-vkorg = t_xls_file-value.
WHEN c_col3. "vtweg
wa_header-vtweg = t_xls_file-value.
WHEN c_col4. "Matnr
wa_header-matnr = t_xls_file-value.
WHEN c_col5. "Kbetr
wa_header-kbetr = t_xls_file-value.
WHEN c_col6. "FROm
wa_header-datab = t_xls_file-value.
WHEN c_col7. "TO
wa_header-datbi = t_xls_file-value.
ENDCASE.
ENDLOOP.
APPEND wa_header TO t_header.
CLEAR wa_header.
ENDIF.
****To process the data
PERFORM f_process.
ENDFORM. " upload_file
*& Form READ_DATA
* text
* --> p1 text
* <-- p2 text
FORM read_data.
****To make Uniq Records in Header Level
SORT t_header BY kschl vkorg vtweg.
DELETE ADJACENT DUPLICATES FROM t_header COMPARING
kschl vkorg vtweg .
SORT t_item BY vkorg vtweg matnr.
DATA : wa1_item TYPE type_item.
DATA : l_cnt TYPE i.
DATA : flag(1) TYPE c. "to process the Line item.
***Looping Header Table.
LOOP AT t_header INTO wa_header.
PERFORM bdc_dynpro US! ING 'SAPMV13A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV13A-KSCHL'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ANTA'.
PERFORM bdc_field USING 'RV13A-KSCHL'
wa_header-kschl.
PERFORM bdc_dynpro USING 'SAPLV14A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV130-SELKZ(03)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=WEIT'.
PERFORM bdc_field USING 'RV130-SELKZ(03)'
'X'.
PERFORM bdc_dynpro USING 'SAPMV13A' '1004'.
PERFORM bdc_field USING 'BDC_CURSOR'
'KOMG-VKORG'.
PERFORM bdc_field USING 'KOMG-VKORG'
wa_header-vkorg.
PERFORM bdc_field USING 'KOMG-VTWEG'
wa_header-vtweg.
****To handle Line Items.
LOOP AT t_item INTO wa1_item WHERE vkorg = wa_header-vkorg AND
vtweg = wa_header-vtweg.
wa_item = wa1_item.
******Flag Set only After processing first 14 records .
IF flag = ' '.
v_lindx = v_lindx + 01.
SHIFT v_lindx LEFT DELETING LEADING '0'.
v_item = v_lindx .
CONCATENATE 'KOMG-MATNR(' v_item ')' INTO v_matnr.
PERFORM bdc_field USING v_matnr
wa_item-matnr.
CONCATENATE 'KONP-KBETR(' v_item ')' INTO v_kbetr.
PERFORM bdc_field USING v_kbetr
wa_item-kbetr.
CONCATENATE 'RV13A-DATAB(' v_item ')' INTO v_dat.
PERFORM bdc_field USING v_dat
wa_item-datab.
CONCATENATE 'RV13A-DATBI(' v_item ')' INTO v_dat1.
PERFORM bdc_field USING v_dat1
wa_item-datbi.
IF v_item = 14.
flag = 'X'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.
PERFORM bdc_dynpro USING 'SAPMV13A' '1004'.
CLEAR v_lindx.
CLEAR v_item.
CONTINUE.
ENDIF.
ENDIF.
***Flag is Set after Processing of 14 records.
****** TO process rest of Records
IF flag = 'X'.
v_pgedwn2 = v_pgedwn2 + 1.
v_lindx1 = v_lindx1 + 01.
SHIFT v_lindx1 LEFT DE! LETING LEADING '0'.
v_item = v_lindx1 .
CONCATENATE 'KOMG-MATNR(' v_it! em ')' INTO v_matnr.
PERFORM bdc_field USING v_matnr
wa_item-matnr.
CONCATENATE 'KONP-KBETR(' v_item ')' INTO v_kbetr.
PERFORM bdc_field USING v_kbetr
wa_item-kbetr.
CONCATENATE 'RV13A-DATAB(' v_item ')' INTO v_dat.
PERFORM bdc_field USING v_dat
wa_item-datab.
CONCATENATE 'RV13A-DATBI(' v_item ')' INTO v_dat1.
PERFORM bdc_field USING v_dat1
wa_item-datbi.
IF v_pgedwn2 = 13.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=P+'.
PERFORM bdc_dynpro USING 'SAPMV13A' '1004'.
v_pgedwn2 = 0.
v_lindx1 = 1.
CLEAR v_item.
CONTINUE.
ENDIF.
ENDIF.
ENDLOOP.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SICH'.
****** Calling Transaction after Processing All items.
CALL TRANSACTION 'VK11' USING bdctab
OPTIONS FROM c_params MESSAGES INTO tmess_mtab.
REFRESH bdctab.
CLEAR : bdctab.
CLEAR : wa_item.
CLEAR : wa1_item.
CLEAR : wa_header.
CLEAR : l_cnt.
CLEAR : v_lindx1.
CLEAR: v_pgedwn2,v_lindx.
LOOP AT tmess_mtab .
l_cnt = l_cnt + 1.
READ TABLE t_item INTO wa_item INDEX l_cnt .
CALL FUNCTION 'MASS_MESSAGE_GET' "To get the Message Text
EXPORTING
arbgb = tmess_mtab-msgid
msgnr = tmess_mtab-msgnr
msgv1 = tmess_mtab-msgv1
msgv2 = tmess_mtab-msgv2
msgv3 = tmess_mtab-msgv3
msgv4 ! = tmess_mtab-msgv4
IMPORTING
msgtext = wa_mtab-text
EXCEPTIONS
message_not_found = 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.
wa_mtab-matnr = wa_item-matnr.
wa_mtab-msgtyp = tmess_mtab-msgtyp.
wa_mtab-msgid = tmess_mtab-msgid.
wa_mtab-msgn! r = tmess_mtab-msgnr.
APPEND wa_mtab TO t_mtab.
CLEAR wa_mtab-text.
CLEAR wa_item.
ENDLOOP.
ENDLOOP.
ENDFORM. " READ_DATA
*& Form BDC_DYNPRO
* text
* -->P_0300 text
* -->P_0301 text
* Start new screen *
FORM bdc_dynpro USING program dynpro.
CLEAR bdctab.
bdctab-program = program.
bdctab-dynpro = dynpro.
bdctab-dynbegin = 'X'.
APPEND bdctab.
ENDFORM. " BDC_DYNPRO
*& Form BDC_FIELD
* text
* -->P_0305 text
* -->P_WA_HEADER_KSCHL text
* Insert field *
FORM bdc_field USING fnam fval.
CLEAR bdctab.
bdctab-fnam = fnam.
bdctab-fval = fval.
APPEND bdctab.
ENDFORM. " BDC_FIELD
*& Form bdc_trc_ansaction
* text
* -->P_0527 text
*& Form f_Process
* text
* --> p1 text
* <-- p2 text
FORM f_process.
DATA : l_todate(12) TYPE c,
l_frdate(12) TYPE c.
***Select for all entries of material in Header "Flat File Materials".
IF NOT t_header[] IS INITIAL.
SELECT matnr vkorg vtweg FROM mvke INTO TABLE t_mvke FOR ALL ENTRIES
IN t_header WHERE matnr = t_header-matnr AND
vkorg = t_header-vkorg AND
vtweg = t_header-vtweg.
ENDIF.
*********select Sales.org & Dist.channel.
IF NOT t_header[] IS INITIAL.
SELECT vkorg vtweg FROM tvkov INTO TABLE t_tvkov FOR ALL ENTRIES IN
t_header WHERE vkorg = t_header-vkorg
AND vtweg = t_header-vtweg.
ENDIF.
***Checking for material in Sales Master Table
SORT t_mvke BY matnr vkorg vtweg.
SORT t_tvkov BY vkorg vtweg.
LOOP AT t_header INTO wa_header.
READ TABLE t_mvke INTO wa_mvke WITH KEY matnr = wa_header-matnr
vkorg = wa_header-vkorg
! ; vtweg = wa_header-vtweg BINARY SEARCH.
IF sy-subrc <> 0.
wa_error = wa_header.
&nb! sp; MOVE text-011 TO wa_error-text.
APPEND wa_error TO t_error.
DELETE TABLE t_header FROM wa_header.
ELSE.
********Date Validations
IF ( wa_header-datab NE ' ! ; ' AND wa_header-datbi NE ' ' ) .
l_todate = wa_header-datab.
l_frdate = wa_header-datbi.
REPLACE '.' INTO l_toda! te WITH ''.
REPLACE '.' INTO l_todate WITH ''.
CONDENSE l_todate NO-GAPS.
REPLACE '.' INTO l_frdate WITH ''.
REPLACE '.' INTO l_frdate WITH ''.
CONDENSE l_frdate NO-GAPS.
IF l_frdate < l_todate.
wa_error = wa_header .
MOVE text-012 TO wa_error-text.
APPEND wa_error TO t_error.
DELETE TABLE t_header FROM wa_header.
ENDIF.
ELSE.
wa_error = wa_header .
MOVE text-016 TO wa_error-text.
APPEND wa_error TO t_error.
DELETE TABLE t_header FROM wa_header.
ENDIF.
ENDIF.
********Rate Validation.
IF wa_header-kbetr = ' '.
wa_error = wa_header .
MOVE text-017 TO wa_error-text.
APPEND wa_error TO t_error.
DELETE TABLE t_header FROM wa_header.
ENDIF.
READ TABLE t_tvkov INTO wa_tvkov WITH KEY vkorg = wa_header-vkorg
BINARY SEARCH.
IF sy-subrc = 0.
READ TABLE t_tvkov INTO wa_tvkov WITH KEY vtweg = wa_header-vtweg
BINARY SEARCH.
IF sy-subrc <> 0.
wa_error = wa_header.
MOVE text-015 TO wa_error-text.
WRITE wa_header-vtweg TO wa_error-text+13(4).
APPEND wa_error TO t_error.
ENDIF.
ELSE.
wa_error = wa_header.
MOVE text-013 TO wa_error-text.
WRITE wa_header-vkorg TO wa_error-text+9(4).
APPEND wa_error TO t_error.
ENDIF.
CLEAR wa_header.
ENDLOOP.
*****Deleting Duplicate Material Form Header "Flat File Data".
SORT t_header BY kschl vkorg vtweg matnr.
DELETE ADJACENT DUPLICATES FROM t_header COMPARING
kschl! vkorg vtweg matnr .
* ****Data Moving from Header to Item Level.
t_item[] = t_header[].
*To count No.of records in Item Table.
DESCRIBE TABLE t_item LINES v_count.
CONCATENATE text-014 ' ' v_count INTO v_bdc.
****Popup to get Confirmation from user to process BDC
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Confirmation of File Data'
text_question = v_bdc
text_button_1 = 'Confirm'
text_button_2 = 'Cancel Run'
default_button = '1'
IMPORTING
answer = c_ans.
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. " f_Process
*& Form f_Refresh
* text
* --> p1 text
* <-- p2 text
FORM f_refresh.
REFRESH : t_xls_file,
t_header,
t_item,
t_mvke,
t_tvkov,
t_error,
t_mtab.
CLEAR : t_xls_file,
wa_header,
wa_item,
wa_mvke,
wa_tvkov,
wa_error,
wa_mtab.
ENDFORM. " f_Refresh
reward point s if it is usefull ....
girish -
I hav to upload bdc for vk11 trans and table konv.
hi experts,
i m new in BDC... i hav to upload bdc for vk11 trans and table konv.
frst doubt is
i hv to run shdb transc?? or just i hv to write program??
nd cn any1 send me teps as hw to create upload..
Condition Type Sales Organisation Distribution channel Material Price Unit Valid from Valid to
KSCHL VKORG VTWEG MATNR_01 KBETR_01 KPEIN_01 DATAB_01 DATBI_01
now plz tel me hw to do this...whether to run shdb or jus to write program in se38..
or i hv to do both...bt plz tel me step by stepPlease don't ignore the warnings. Read the rules of engagement.
Thread locked, again.
Thomas
wrking on ABAP OOPS, oput is coming but 1 field name wd customer name is nt -
hi!
can anybody plz tell me how to do bdc for vk11 and vk12.
the scene is that i have zpogram which displays the data and from there i have to add one button and whenever that button is triggred bdc had to be performed for vk11 and vk12 only for those fields which are diaplayed by my z program.
kindly help me out.
regards
anjaliHi Anjali
It is not advicable to create BDC for transactions like VK11, MEK1 ... which we use to create condition records. The reason is for each condition type, the options we see might vary when ever there is change in access sequences and their precedence. So if we create BDC, our program needs to modified everytime there is change in the access sequences and condition tables.
I would recommed you to either use the program that i have provided or use some BAPI's to upload/change condition records.
As you are saying, you have the data in your internal table. Download the data to a file in the format RV14BTCI needs and SUBMIT the program.
For understanding on the structure for this program, use transaction SXDB.
Kind Regards
Eswar -
Hi All,
I got a requirement to upload Condition records through trnx VK11 , but I have one doubt , how can we handle the radio buttons ( Table ) dyamically for every Condition type???
Ex : for condition type 'X' it has choose the table '111' and for condition type 'Y' it has to choose '222' and so on ...
How to do the recording for this requirement ???
I am really confused with this...Please suggest me
Thanks in advance.Hi,
Why don't you use BAPI BAPI_PRICES_CONDITIONS instead?
Please check this sample code from other thread.
wtable1-table_no = '306'.
wtable1-applicatio = 'V'.
wtable1-cond_type = 'ZPR0'.
wtable1-operation = '009'.
wtable1-varkey = '13001001USD 000000000050068946'.
wtable1-valid_to = '99991231'.
wtable1-valid_from = '20051101'.
wtable1-cond_no = '$000000001'.
APPEND wtable1 TO table1.
wtable2-operation = '009'.
wtable2-cond_no = '$000000001'.
wtable2-created_by = sy-uname.
wtable2-creat_date = '20051022'.
wtable2-cond_usage = 'A'.
wtable2-table_no = '110'.
wtable2-applicatio = 'V'.
wtable2-cond_type = 'ZPR0'.
wtable2-varkey = '13001001USD 000000000050068946'.
wtable2-valid_from = '20051101'.
wtable2-valid_to = '99991231'.
APPEND wtable2 TO table2.
wtable3-operation = '009'.
wtable3-cond_no = '$000000001'.
wtable3-cond_count = '01'.
wtable3-applicatio = 'V'.
wtable3-cond_type = 'ZPR0'.
wtable3-scaletype = 'A'.
wtable3-scalebasin = 'C'.
wtable3-scale_qty = '1'.
wtable3-cond_p_unt = '1'.
wtable3-cond_unit = 'EA'.
wtable3-calctypcon = 'C'.
wtable3-cond_value = '454'.
wtable3-condcurr = 'USD'.
APPEND wtable3 TO table3.
CALL FUNCTION 'BAPI_PRICES_CONDITIONS'
EXPORTING
PI_initialmode = 'X'
PI_BLOCKNUMBER =
TABLES
ti_bapicondct = table1
ti_bapicondhd = table2
ti_bapicondit = table3
ti_bapicondqs = table4
ti_bapicondvs = table5
to_bapiret2 = table6
to_bapiknumhs = table7
to_mem_initial = table8
EXCEPTIONS
update_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.
READ TABLE table6 WITH KEY type = 'E' TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
loop at table6 into ret.
write: / ret-type, ret-message, ret-id, RET-LOG_NO, RET-LOG_MSG_NO,
RET-MESSAGE_V1, RET-MESSAGE_V2, RET-MESSAGE_V3, RET-MESSAGE_V4,
RET-PARAMETER,RET-ROW,RET-FIELD.
endloop.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
*EXPORTING
WAIT =
IMPORTING
return = ret
ENDIF.
Also there are other options:
- from LSMW the report RV14BTCI
- batch input to transaction XK15
- using FM modules RV_CONDITION* (e.g. _copy and _save)
Hope this will help.
Regards,
Ferry Lianto -
Bdc on vk11 using control break events
hi
have any one done bdc for vk11 using control break events.my flat file is
ZTAX X IN 1000 1200 2000 A0
ZTAX X IN 1000 1210 3000 A1
ZTAX X US 7676 01 4000 L3
ZTAX X US 7676 02 5000 s1
i need the logic for this any sample code will be usefulhi, check the sample code using Control break statements.
LOOP AT IT_MAIN.
WRITE : IT_MAIN.
C_TABIX = SY-TABIX.
<b>AT NEW LIFNR_001.</b>
READ TABLE IT_MAIN INDEX C_TABIX.
REFRESH IT_BDC.
perform bdc_dynpro using 'SAPMM06E' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RM06E-BSTNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'EKKO-LIFNR'
IT_MAIN-LIFNR_001.
perform bdc_field using 'RM06E-BSART'
IT_MAIN-BSART_002.
perform bdc_field using 'RM06E-BEDAT'
IT_MAIN-BEDAT_003.
perform bdc_field using 'EKKO-EKORG'
IT_MAIN-EKORG_004.
perform bdc_field using 'EKKO-EKGRP'
IT_MAIN-EKGRP_005.
perform bdc_field using 'RM06E-LPEIN'
IT_MAIN-LPEIN_006.
perform bdc_field using 'RM06E-WERKS'
IT_MAIN-WERKS_007.
MOVE 1 TO CNT.
<b>ENDAT.</b>
perform bdc_dynpro using 'SAPMM06E' '0120'.
perform bdc_field using 'BDC_CURSOR'
'EKPO-TXZ01(01)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
CONCATENATE 'EKPO-EMATN(' CNT ')' INTO FLD.
perform bdc_field using FLD IT_MAIN-EMATN_01_008.
CONCATENATE 'EKPO-TXZ01(' CNT ')' INTO FLD.
perform bdc_field using FLD IT_MAIN-TXZ01_01_009.
CONCATENATE 'EKPO-MENGE(' CNT ')' INTO FLD.
perform bdc_field using FLD IT_MAIN-MENGE_01_010.
perform bdc_dynpro using 'SAPMM06E' '0120'.
perform bdc_field using 'BDC_CURSOR'
'RM06E-EBELP'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
CNT = CNT + 1.
IF CNT = 6.
CNT = 1.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=P+'.
ENDIF.
<b>AT END OF LIFNR_001.</b>
READ TABLE IT_MAIN INDEX C_TABIX.
RECORD = IT_MAIN.
perform bdc_dynpro using 'SAPLSPO1' '0100'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
CALL TRANSACTION 'ME21' USING IT_BDC MODE 'A' MESSAGES INTO IT_MESSAGES.
clear: cnt, C_tabix .
<b>ENDAT.</b>
ENDLOOP. -
Standard BDC for t.code: FB01
Hi,
Is there any standard BDC available for T.code: FB01.
Thanks and Regards,
VKHi,
You can use standard program RFBIBL00 or BAPI BAPI_ACC_DOCUMENT_POST for this purpose.
Creating BDC for FB01 mainly depends on your need. A generic one is difficult to be created due to multiple alternative screeens.
Regards,
Gaurav -
Hi All,
I have created a BDC for T-Code VK11. When I am loading the data then my BDC is throwing an error becoz for some materials Unit of Measurement(UOM) sceen is coming which I have not captured in BDC. This UOM is coming only for few materials and this screen is not coming when I m entering these materials manually.
Can anybody plz help me out in solving this.
Warm Regards,
NishuDo a recording with a material which is throwing u the UOM screen .
IF ur flat file is not having Uom pick the values for the materials from MARA/ MARM table into a variable and submit it to the screen of UOM.
See a recording will be done considering the fact that all the possible scenarios are handled . So If the screen is popping up with a UOM screen then it has to be handled .
You have to capture this in ur BDC recording .
Cause even it throws the UOM screen for one material u need to handle that .
There is one more screen for UOM jsut do a select and pass the UOM for the material in the code
if u r not intending to maintain the same in ur flat file.
Regards,
vijay -
Hi All,
We have to write a BDC for FB09 depending upon the company code as given in the selection screen.But we have observed that the screens for FB09 corresponding to each company code varies.this is because of different configurations which has been done for different company codes. So please suggest us if there is any generic method to implement it as we cann't do the recording for each of the company code(As no of company code is 200).
Thanks
RajHi,
use fm FI_FIELD_SELECTION_DETERMINE
to dtermine your field-status of account / posting key
and look here:
Re: Access to GL Field Status Group Settings
Message was edited by: Andreas Mann -
Error while running a BDC for the Transaction F-02
Hi,
I'm getting an error <b><i>"Parking not possible during Batch Input"</i></b> while running a BDC for the transaction F-02.
When i click on the error message it displays the message [b<i>]"In Customizing, you can control whether an error message is issued."</b></i>
How to solve this issue?.
Waiting for ur replies.........
Regards
N.SenthilHi,
When you are doing the recording in SHDB, and in the same screen where the TCODE to be recorded is given, there are options that you can choose called "Recording Parameters"...Select the checkbox which says "Not a Batch Input Session", this will set the sy-binpt variable to " "(in a recording by default it is "X")...and you will not get this error...
Also make sure while writing the BDC program to make use of the "bdc options" parameter which has this property to switch of sy-binpt...
Refer below theard for sample bdc code for f-02.
https://forums.sdn.sap.com/click.jspa?searchID=5126766&messageID=1538409
Regards -
Problem in creation of BDC for transaction phap_create
Hello Friends,
I am trying to create BDC for PHAP_CREATE.
When you run a transaction a pop up window appears to select the template id.
And in BDC it is selected by cursor position. So once selected, the value of template id cannot be changed.
I want this as a parameter.So that each time I run a BDC I will be able to create different types of Appraisal documents i.e with different template ids.
How to go about it???
Regards,
BhushanHi,
For selecting the id, while doing recording,
record with
CTRL + F ( Where u can give ur id) and proceed further. -
How to give line items in flatfile while doing BDC for Table control
Hi all,
I am writing BDC for Multiple line items and Transaction is : FSE5N.
How do i give the data in the flat file. I mean how do we give the multiple line items in flat file , i.e for second line item again we have to header data or not ?
ex:
1015;ALL;demo;kr;INR;01;0001;3000172;100
1015;ALL;demo;kr;INR;01;0001;3000172;200
for first lineitem : 3000172;100
for 2nd line item : 3000172; 200.
header data : 1015;ALL;demo;kr;INR;01;0001.
Thanks in advance
krupaliHii ,
u can give in the same format as u have done in the example.
A B C D E F G H I
1015;ALL;demo;kr;INR;01;0001;3000172;100
1015;ALL;demo;kr;INR;01;0001;3000172;200
and while writing the loop u can give
loop at it_head.
loop at it_head where a = it_head-A and b = it_head-B ..........upto G = it_head-G.
endloop.
endloop.
check this
http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
Neeraj -
Hi Friends,
I am facing problem while developing BDC for tcode F150. The last action i.e. scheduling for particular dunning date is not getting executed in my BDC.
I am also pasting the end part of my BDC recording. Please review it and advise.
PERFORM bdc_dynpro USING 'SAPLF150_JOBS' '1000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'F150V-STRZT'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=JOBS'.
PERFORM bdc_field USING 'F150V-STRDT'
rdate.
PERFORM bdc_field USING 'F150V-XSTRF'
'X'.
select single SPLD into p_out from USR01 where bname = sy-uname.
perform bdc_field using 'ITCPO-TDDEST'
p_out.
CALL TRANSACTION 'F150'
Thank you,
Swapnil
Edited by: Swapnil Tawade on Sep 22, 2008 3:15 PMHi,
If u want it for some specific plants then before populating data to bdcdata internal table check the conditions for which the plant fields required values to be passed and if the condition is satisfied then pass the plant field to bdcdata table . If the condition is not satisfied then dont pass that plant field to bdcdata table bcoz if u r not passing any field to bdcdata table then that field is going have default values.
Regards,
Shafi -
Hello All,
A code has been written in the User exit for Tcode ME22N, Which sets the indicator on PO line item. This has been done by modifying the standard itab POT by using field symbols, because the fields to be modified are shown in display mode in the tcode ME22N and cannot be done in BDC. See the below code in user exit ZXM06U43.
DATA char(50) VALUE '(SAPLMEPO)POT[]'.
CLEAR wa_ind.
FIELD-SYMBOLS <f1> TYPE ANY.
Move memory of internal table POT to field symbol f1.
ASSIGN (char) TO <f1>.
Move content of f1 to internal table i_ind
i_ind[] = <f1> .
LOOP AT i_ind INTO wa_ind.
IF wa_ind-pstyp = '9'. " Service PO - item category
IF PO Line item has History per Purchasing Document as 'D'
Set indicators on, for the line item.
CLEAR v_cnt.
SELECT COUNT( * ) INTO v_cnt FROM ent5100
WHERE ebeln = wa_ind-ebeln
AND ebelp = wa_ind-ebelp
AND bewtp = 'D'.
IF sy-subrc = 0.
wa_ind-wepos = 'X'. " Set Goods Receipt Indicator
wa_ind-webre = 'X'. " Set GR-based IV Indicator
wa_ind-lebre = 'X'. " Set Srv-based IV Indicator
ELSE.
*End of addition SAP-20070910104025 - SL36 - D01K963369
wa_ind-wepos = ' '. " Clear Goods Receipt Indicator
wa_ind-webre = ' '. " Clear GR-based IV Indicator
wa_ind-lebre = ' '. " Clear Srv-based IV Indicator
wa_ind-xersy = ' '. " Clear ERS Indicator
ENDIF.
MODIFY i_ind FROM wa_ind INDEX sy-tabix.
ENDIF.
ENDLOOP.
<f1> = i_ind[].
ENDIF.
ENDIF.
This code is in production and has been working fine.
The requirnment is now to make this indicator work for all the Purchase order before this code has been written in the Exit. For this my functional suggests that to write a separate program using BDC for PO change and jus add a period/dot in the short text and save it. The code has been written, the user exit and the above code is getting triggrred values are updated in internal table correctly.
However the flags was not set or cleared when seen in the tcode ME22N . This works fine if the tcode me22n is run directly and not working in BDC.
I have tried with ME22 without enjoy transaction in BDC changing the POT Program to SAPMM06E. It does not work.
Please help me as why it is not uodating in the table when using BDC.
Thanks in Advance.
Senthil KumarHi All,
Any luck on this??
Thanks -
Error while creating the Generic Connector for flatfile
Hi All,
I was trying to create the Generic connector for the flat file reconciliation. But i was throwed into errors. I'm using 11.1.1.3 OIM and as well as SOA also. I have been following the OIM 9 document to create the GENERIC connector.
i'm copying the error i got
<Mar 14, 2012 3:48:12 PM IST> <Warning> <XELLERATE.SERVER> <BEA-000000> <readme.txt is not a valid connector resource file.>
<Mar 14, 2012 3:48:12 PM IST> <Warning> <XELLERATE.SERVER> <BEA-000000> <readme.txt is not a valid connector resource file.>
<Mar 14, 2012 3:48:12 PM IST> <Error> <XELLERATE.WEBAPP> <BEA-000000> <Class/Method: CreateConnectorAction/imageScreen encounter some problems: >
java.lang.NullPointerException
at oracle.iam.platform.utils.OIMMessageResourcesUtil.getConnectorResourcesFromFile(OIMMessageResourcesUtil.java:964)
at oracle.iam.platform.utils.OIMMessageResourcesUtil.getConnectorResourceBundle(OIMMessageResourcesUtil.java:778)
at oracle.iam.platform.utils.OIMMessageResourcesUtil.getConnectorResources(OIMMessageResourcesUtil.java:764)
at com.thortech.xl.webclient.util.tcMessageResourcesUtil.getConnectorResources(tcMessageResourcesUtil.java:215)
at com.thortech.xl.webclient.util.tcMessageResourcesUtil.getMsgFromConnectorRes(tcMessageResourcesUtil.java:238)
at com.thortech.xl.webclient.util.tcMessageResourcesUtil.getLocalizedText(tcMessageResourcesUtil.java:66)
at com.thortech.xl.webclient.util.UIFacade.getUserDefLocalizedLabels(UIFacade.java:3024)
at com.thortech.xl.webclient.actions.CreateConnectorAction.imageScreen(CreateConnectorAction.java:1250)
at com.thortech.xl.webclient.actions.CreateConnectorAction.goNext(CreateConnectorAction.java:521)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
at com.thortech.xl.webclient.actions.tcLookupDispatchAction.execute(tcLookupDispatchAction.java:133)
at com.thortech.xl.webclient.actions.tcActionBase.execute(tcActionBase.java:894)
at com.thortech.xl.webclient.actions.tcAction.execute(tcAction.java:213)
at com.thortech.xl.webclient.actions.CreateConnectorAction.execute(CreateConnectorAction.java:135)
at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.am.agent.wls.filters.OAMServletAuthenticationFilter.doFilter(OAMServletAuthenticationFilter.java:260)
at oracle.security.am.agent.wls.filters.OAMValidationSystemFilter.doFilter(OAMValidationSystemFilter.java:133)
at oracle.security.wls.oamagent.OAMAgentWrapperFilter.doFilter(OAMAgentWrapperFilter.java:121)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at com.thortech.xl.webclient.security.XSSFilter.doFilter(XSSFilter.java:103)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at com.thortech.xl.webclient.security.CSRFFilter.doFilter(CSRFFilter.java:61)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.iam.platform.auth.web.PwdMgmtNavigationFilter.doFilter(PwdMgmtNavigationFilter.java:115)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.iam.platform.auth.web.OIMAuthContextFilter.doFilter(OIMAuthContextFilter.java:100)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
i'm just using a flat file which contents are normal.
#GTC Trusted Source
login,firstName,lastName,eMail,organization
RDUDE,Robert,Dude,[email protected],Xellerate Users
Can somebody help where i have done wrong for this. All my deployment is in oracle linux 4.5
Thanks,
VenkateshFollow the doc for 11g, guide you might be missing something:
http://docs.oracle.com/cd/E17904_01/doc.1111/e14309.pdf
Highlevel configuration steps (not all and exact) are:
-> Give it Name
-> select Reconciliation
-> Select Transport Provider and format provides
-> select Trusted Source Reconciliation
->provide flat file details
-> Source reconciliation staging and mapping
->finish
regards,
GP
Maybe you are looking for
-
New Hard Drive Installed on 4-1115DX
Hello I recently lost my hard drive but luckily backed up using AOEMI Backupper. I purchased a new 500GB hard drive and installed it but now the 'D' 32GB SSD Drive is redundant? How do I re-enable the RAID rapid start drive. When I use the RAID soft
-
3 confirmed Dimensions and 2 fact tables
Hi experts, how can we connect 3 confirmed Dimensions and 2 fact tables without loops and traps please give me a solution
-
Annotations missing from toplink.jar
The download of Toplink 11g includes the toplink.jar along with a few other jar files and a source .zip file. The toplink.jar does not include the oracle.toplink.annotations package which is necessary to use the @Convert and @Converter annotations fo
-
Quicktime 7.0.3 and FCP 4.5
Are there major issues with these two? I am on 10.3.9 OS FCP has been acting a little weird since installing QT 7.0.3. It's harder to make exact cuts in the timeline among other issues.
-
LightRoom 2.4 Trial & Catalog Import
Hi I currently use PSE 7.0 I am interested in trying the latest version of Lightroom. Is there a 2.4 Trial? Where is it? I can only find the 2.0 trial on Adobe site. Also Did Adobe fix the PSE 7 catalog import. Can Lightroom 2.4 Import PSE 7 catalogs