VK11 screen
Dear all,
On the screen of TCode VK11, how to show the button Maintain formula as this screenshot below:
http://i358.photobucket.com/albums/oo30/vquang124/VK11.jpg
Pls help me,
Thanks,
Quanglv
i think KONP-KMEIN is ready to input , so why do you enter MIL itself ? , or maintain alternative UoM for those kind of materials in MM01.
regards
Prabhu
Similar Messages
-
Hi All,
Can anybody tell me, how can we programatically create the VK11 screen with different key combination.
My requirement is to update set of Z-Tables . Using condition types, and the same functionality like VK11.
For each condition type, the screen will be created dynamically. Say if you are selecting key combination SOLD-TO/MATERIAL
the screen fields will be automatically determind as sold-to material value valid from valid to etc etc.
Please let me know your comments on the same.
Regards,
Tapodipta Khan.Hi,
This field will be based on the Condtion type which you are giving in the first screen. But however this fields are from the Condition tables (AXXX) for that Condition Types. Try to see the main programs of the Screens (System--->Status) and I have tried through that way and this program name was different for each condition type Differ from System to system (Customization).
XXX - Condition table number.
By default Validity period will be there for each condition type.
Regards,
Srinivas -
SD Pricining Condition Up to 7 Decimals Places
Hi All,
I want to maintain condition record up to 7 decimal places. In normal scenario we can maintain up to 2 decimal places and can be customized upto 5 decimals . How I can achieve this requirement ?
Please help me .......
Thanks & Regards
N. N. TiwariThe simple work around is that in VK11, you maintain the price per ten thousand.
Let us assume, the selling price of Material A is 5.123456, your VK11 screen should be
Material A::::::::::51234.56::::INR::::10000::::PC
thanks
G. Lakshmipathi -
New tax for Retail ... gujrat
hI.
In gujrat .. new addlt tax has come for 2.5% ..after budget. In IS-Retail pricing .. how to do it ?
can anyone help !!!!
Regards
KrishnaHi,
Create a condition type in the customizing screen, with its access sequence and condition tables related to which fields you want the effect of the tax to apply:
then go to Vk11 screen and enter the tax rate and its validity along with the relevant details.
assign your condition type to the pricing procedure you are using in the relevant position, where you want this condition type to display.
regards,
Siddharth. -
Can we maintain diff tax codes for one tax condition type in creating CRs
Hi Gurus,
Can we maintain diff tax codes for one tax condition type during maintaining of Condition Records. (Taxes)
For example in VK11 screen for different combination of tax classification for customer and tax classification for material and
tax codes like P0, P1, P2 etc. If so which tax code will be picked during creation of sales order? Pls help me........
Regards.......DivakaranHi Karan,
Yes we can.
For example you have three tax code
P0 -- 0% (Fully exempt)
P1-- 5% (Half tax)
P2 -- 10% (Full tax)
Now when you create the condition record then you have to create the three condition record for one condition type
MWST
Country -- tax classification of customer -- tax classification of material -- Tax % -- Tax code
IN -
> 0 (Tax exempt) -
> 1 (Full tax) -
> 0 -
> P0
IN -
> 1 (half Tax ) -
>1 (Full tax) -
> 5% -
> P1
IN -
> 2 (Full Tax ) -
> 1 (Full tax) -
> 10% -
> P2
Hope it helps,
Regards,
MT
Edited by: M T on Mar 23, 2010 4:19 PM
Edited by: M T on Mar 23, 2010 7:27 PM -
Create pop up screen in vk11 for uom field
hi ,
i need to create a pop up screen in vk11 for uom (i.e KONP-KMEIN) field .
Because when ever the user enter the necessary fields and press enter, then the uom field is directly displaying as 'CFC'
but here i need to enter 'MIL' for this purpose i need to display a pop up screen.
So kindly suggest me.
thanks in advance,
kool.i think KONP-KMEIN is ready to input , so why do you enter MIL itself ? , or maintain alternative UoM for those kind of materials in MM01.
regards
Prabhu -
Validating screen fields in VK11/VK12 tcodes
Hello all,
My requirement is while creating/changing condition record via VK11 or VK12 user enter rate > 50% THEN error message
needs to be displayed.
For this I have implemented BADI SD_COND_SAVE_A to validate the rate of the condition record.
My issue is...after geeting error message when i click on back button and go back to correct the rate value...
it's copying the rate in all line items.
LOOP at ct_konpdb_new INTO wa_konpdb_new.
wa_konpdb_new-kbetr = wa_konpdb_new-kbetr * -1.
IF wa_konpdb_new-kbetr GT 500.
MESSAGE e042(XXXXXXX).
ENDIF.
Can you please tell me how to correct this issue.
regards,
LokeshHi
Try with this tcode:
function z_sd_00503305.
*"*"Interfase local
*" IMPORTING
*" VALUE(FIELDNAME) TYPE SEFELD
*" VALUE(VALUE)
*" VALUE(KOMG_I) TYPE KOMG
*" VALUE(KONP_I) TYPE KONP
*" VALUE(T681E_I) TYPE T681E
*" CHANGING
*" REFERENCE(CHECK_FIELD) TYPE CHAR1
*" REFERENCE(RETURNCODE) TYPE SUBRC
* break: username.
check sy-tcode = 'VK12' or sy-tcode = 'VK11'.
case t681e_i-kvewe.
case t681e_i-kotabnr.
when '071'. "your table A071,
if fieldname = 'WERKS'.
"YOUR ALGORITHM TO CHECK ENTRIES
returncode = sy-subrc.
endif.
when '155'. "and so on
endcase.
endcase.
endfunction.
To know how to work with BTE, please, check this [article|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/207835fb-0a01-0010-34b4-fef1240ba9b7] by Lakshman Tandra.
Regards
Eduardo -
Screen Resolution in table control bdc
Hi ,
Im working on bdc table control using call transaction method for vk11 and mek1.While uploading data for vk11 for the first time it is taking all the records of the input file and if i do the same for the second time by changing the amount value it is taking only 24 records .(i.e if the input file contains only 24 records it wil update else if it has 25 records or more it not updating even single record and it is showing error " No batch input data for screen sapmv13A ..)...this issue is with the production server......................whereas in development and quality servers there is no problem....................
what migh be the problem and how to solve it?
can anyone plz help me on thisif its a problem in screen resolution then while recording through SHDB mark the check box default size
or
to make the bdc execute in standard screen size check the code below
data x_ctuparams type ctu_params.
x_ctuparams-defsize = 'X'. " This would freeze the resolution in any system
x_ctuparams-dismode = 'N'.
x_ctuparams-updmode = 'S'.
call transaction <TCODE> using it_bdcdata options from x_ctuparams.
So whatever is the screen size of the users front-end, the BDC will execute in standard screen size -
Hi,
I need to put an authority check before saving in Tcode VK11.
I used BADI SD_COND_SAVE_A to put the checking. I needed to output a message then go back to the same screen with the entered values in the screen still in it.
How Can I make the program go back to the screen with its values.
Below is my code:
AUTHORITY-CHECK OBJECT 'V_KONH_VKO'
ID 'ACTVT' FIELD c_activity
ID 'VTWEG' FIELD v_spart.
IF sy-subrc NE 0.
MESSAGE w012(zsd) WITH v_material.
ENDIF.
Thanks in advance!
Regards,
MarcoHi Kumar,
Thanks for the reply.
This is what Im looking for. But unfortunately it is having an error message ($$00000001 in function group) when ever I would change the values and hit the save button again.
When I debug it, whats happening is that an internal table is not getting refresh in this process thus calling the error message. There is no way I can refresh this table because it is not present in the BADI. -
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 -
Uploading of vk11 (pricing condition) transaction
Hi friends,
I have to upload data from legacy system to SAP using VK11 tcode , can use LSMW for VK11 transaction ? . I have to use batch input standard program....
when we open VK11 tranaction first its asking for condition type ( KSCHL ) for each condition type the next screen is varying .
is it possible to do using recording.?
otherwise
is there any stanadard LSMW program for this ,in the batch input.
what is that program how to use that program.
can any body help me in this regard.
Regards,
JayanHi,
For pricing conditions you will be having the condition type and table name in the
first screen of the VK11 transaction.
In the second screen of VK11 you can see the fields will be varing based up on the
table name you are specifying the first screen.
You can use field VAKEY in the batch input program to pass all the values.
For example:
Your table name A601 contians three fields mentioned below.Leave the fields such as
KAPPL,KSCHL,DATBI,DATAB,KBSTAT,KNUMH since these will be avialble for all the tables.
the rest varing fields are
VKORG VKORG CHAR 4
VTWEG VTWEG CHAR 2
SPART SPART CHAR 2
KUNNR KUNNR_V CHAR 10
KONDA KONDA_V CHAR 2
MATNR MATNR CHAR 18
KFRST KFRST CHAR 1
You need to pass the value of all the fields to the VAKEY in the batch input program.
using offset option mentioned below.
VAKEY+0(4) = source-vkorg.
VAKEY+4(2) = source-vkorg.
VAKEY+6(2) = source-vkorg.
VAKEY+8(10) = source-vkorg.
VAKEY+18(18) = source-vkorg.
VAKEY+ 36(1) = source-vkorg.
Hope this will help you -
Amount field of VK11 isnt fetching from flatfile when im performing it'sBDC
Dear Guru,
Here i have encountered a typical issue.
Im Performing BDC for VK11 (Create Condition Record) with "Key Combination" --->> "Location, Material Code (Base Price for Longs)".
While I am running this BDC ( source code attached below) in All screen mode every datas which are of type "CHAR" like--->>
Condition type(kschl) ,
Plant(werks) ,
Material No(matnr),
Valid From date(datab),
Valid To date(datbi),
Rate Unit(konwa) are coming properly from flatfile except
Rate (condition amount - KBETR) which is are of data type "CURR".
So guru I want to know what code i should add into my below bdc prog to fetch data properly into RATE - Condition amount field which is of type " CURR".
Pls Help.
Source Code:
REPORT z_bdc_vk11_famd
NO STANDARD PAGE HEADING LINE-SIZE 255.
*& DATA-DECLARATION
TYPES: BEGIN OF t_cust,
kschl LIKE rv13a-kschl,
werks LIKE komg-werks,
matnr LIKE komg-matnr,
kbetr LIKE konp-kbetr,
*** konwa LIKE konp-konwa,
datab LIKE rv13a-datab,
datbi LIKE rv13a-datbi,
END OF t_cust.
TYPES: BEGIN OF t_sucrec,
cnum TYPE komg-werks,
cnam TYPE komg-matnr,
END OF t_sucrec.
TYPES: BEGIN OF t_errrec,
lineno TYPE string, "Line Number
message TYPE string, "Error Message
END OF t_errrec.
DATA: v_file TYPE string, "Variable for storing flat file
it_cust TYPE STANDARD TABLE OF t_cust, "Internal table of Customer
wa_cust LIKE LINE OF it_cust, "Workarea of Internal table it_cust
it_sucrec TYPE STANDARD TABLE OF t_sucrec,
"Internal table of Success records
wa_sucrec LIKE LINE OF it_sucrec,
"Workarea of Internal table it_sucrec
it_errrec TYPE STANDARD TABLE OF t_errrec,
"Internal table of Error records
wa_errrec LIKE LINE OF it_errrec,
"Workarea of Internal table it_errrec
it_bdctab LIKE bdcdata OCCURS 0 WITH HEADER LINE,
"Internal table structure of BDCDATA
it_messagetab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE,
"Tracing Error Messages
v_date LIKE sy-datum, "Controlling of session date
v_index LIKE sy-tabix, "Index Number
v_totrec TYPE i, "Total Records
v_errrec TYPE i, "Error Records
v_sucrec TYPE i, "Success Records
v_sesschk TYPE c. "Session maintenance
*& SELECTION-SCREEN
SELECTION-SCREEN: BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001 NO
INTERVALS.
PARAMETERS: p_file TYPE rlgrap-filename.
"rlgrap-filename is a predefined structure
SELECTION-SCREEN: END OF BLOCK blk1.
SELECTION-SCREEN: BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002 NO
INTERVALS.
PARAMETERS: p_mode LIKE ctu_params-dismode DEFAULT 'N',
p_update LIKE ctu_params-updmode DEFAULT 'A'.
SELECTION-SCREEN END OF BLOCK blk2.
*& INITIALIZATION
INITIALIZATION.
v_date = sy-datum - 1.
*& AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = ' '
IMPORTING
file_name = p_file.
*& START-OF-SELECTION
START-OF-SELECTION.
v_file = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = v_file
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = it_cust
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc = 0.
****MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
**** WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*& END-OF-SELECTION
END-OF-SELECTION.
LOOP AT it_cust INTO wa_cust.
v_index = sy-tabix.
PERFORM bdc_dynpro USING 'SAPMV13A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV13A-KSCHL'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ANTA'.
PERFORM bdc_field USING 'RV13A-KSCHL'
wa_cust-kschl.
PERFORM bdc_dynpro USING 'SAPLV14A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV130-SELKZ(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=WEIT'.
PERFORM bdc_dynpro USING 'SAPMV13A' '1595'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV13A-DATBI(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'KOMG-WERKS'
wa_cust-werks.
PERFORM bdc_field USING 'KOMG-MATNR(01)'
wa_cust-matnr.
PERFORM bdc_field USING 'KONP-KBETR(01)'
wa_cust-kbetr.
PERFORM bdc_field USING 'KONP-KONWA(01)'
'INR'.
PERFORM bdc_field USING 'RV13A-DATAB(01)'
wa_cust-datab.
PERFORM bdc_field USING 'RV13A-DATBI(01)'
wa_cust-datbi.
PERFORM bdc_dynpro USING 'SAPMV13A' '1595'.
PERFORM bdc_field USING 'BDC_CURSOR'
'KOMG-MATNR(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SICH'.
CALL TRANSACTION 'VK11' USING it_bdctab
MODE p_mode
UPDATE p_update
MESSAGES INTO it_messagetab.
IF sy-subrc = 0.
*& reading success records to corresponding internal table
READ TABLE it_messagetab WITH KEY msgtyp = 'S'.
IF sy-subrc = 0.
* wa_sucrec-cnum = it_messagetab-msgv1.
wa_sucrec-cnum = wa_cust-werks.
wa_sucrec-cnam = wa_cust-matnr.
APPEND wa_sucrec TO it_sucrec.
CLEAR wa_sucrec.
ENDIF.
ELSE.
*& reading error records to corresponding internal table
READ TABLE it_messagetab WITH KEY msgtyp = 'E'.
IF sy-subrc = 0.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = sy-msgid
no = it_messagetab-msgnr
v1 = it_messagetab-msgv1
v2 = it_messagetab-msgv2
v3 = it_messagetab-msgv3
v4 = it_messagetab-msgv4
IMPORTING
msg = wa_errrec-message.
wa_errrec-lineno = v_index.
APPEND wa_errrec TO it_errrec.
CLEAR wa_errrec.
ENDIF.
ENDIF.
CLEAR : it_bdctab, it_messagetab.
REFRESH: it_bdctab, it_messagetab.
ENDLOOP.
DESCRIBE TABLE it_cust LINES v_totrec.
DESCRIBE TABLE it_errrec LINES v_errrec.
DESCRIBE TABLE it_sucrec LINES v_sucrec.
PERFORM disp_data.
SKIP 2.
IF v_sucrec > 0.
PERFORM disp_success_data.
ENDIF.
SKIP 2.
IF v_errrec > 0.
PERFORM disp_error_data.
ENDIF.
*& Form bdc_dynpro
*# text
*# -->P_0104 text
*# -->P_0105 text
FORM bdc_dynpro USING program dynpro.
CLEAR it_bdctab.
it_bdctab-program = program.
it_bdctab-dynpro = dynpro.
it_bdctab-dynbegin = 'X'.
APPEND it_bdctab.
ENDFORM. " bdc_dynpro
*& Form bdc_field
FORM bdc_field USING fnam fval.
CLEAR it_bdctab.
it_bdctab-fnam = fnam.
it_bdctab-fval = fval.
APPEND it_bdctab.
ENDFORM. " bdc_field
*& Form disp_data
FORM disp_data .
ULINE (45).
WRITE : / sy-vline,
4 'FAMD Price Master UPDATE SUMMARY'(004) COLOR 1,
45 sy-vline.
ULINE /(45).
WRITE : / sy-vline,
'Total Records Processed'(007),
28 '=',
30 v_totrec,
45 sy-vline,
/ sy-vline,
'Error Records'(005),
28 '=',
30 v_errrec,
45 sy-vline,
/ sy-vline,
'Successful Records'(006),
28 '=',
30 v_sucrec,
45 sy-vline.
ULINE /(45).
ENDFORM. " disp_data
*& Form disp_success_data
FORM disp_success_data .
ULINE (45).
WRITE : / sy-vline,
14 'Successful Records'(012) COLOR 1,
45 sy-vline.
ULINE /(45).
WRITE : / sy-vline ,
'Plant Number'(010) COLOR 2,
17 sy-vline,
25 'Material Number'(011) COLOR 2,
45 sy-vline.
ULINE /(45).
LOOP AT it_sucrec INTO wa_sucrec.
WRITE: / sy-vline ,
wa_sucrec-cnum,
17 sy-vline,
19 wa_sucrec-cnam,
45 sy-vline.
ENDLOOP.
ULINE /(45).
ENDFORM. " disp_success_data
*& Form disp_error_data
FORM disp_error_data .
ULINE (90).
WRITE : / sy-vline,
35 'Error Records'(013) COLOR 1,
90 sy-vline.
ULINE /(90).
WRITE : / sy-vline,
'Record Number'(008) COLOR 2,
sy-vline,
37 'Reason for error'(009) COLOR 2,
90 sy-vline.
ULINE /(90).
LOOP AT it_errrec INTO wa_errrec.
WRITE : / sy-vline,
wa_errrec-lineno,
17 sy-vline,
wa_errrec-message,
90 sy-vline.
ENDLOOP.
ULINE /(90).
ENDFORM. " disp_error_data
Flat file Sequence:
Condition Type Plant Matrial No Rate Validity start date Validity end dateI worked out n i hav found the solution
-
Customer heirachy 3data is not populating in condition record(vk11)- urgent
Gurus
Please some one can help me on this issue , very urgent.
also ask me if you have any further questions.
my access seuqence key combination are
sales org,
Distribution channel,
customer heirarchy3 ,
product heirachy1,
product heirachy2,
product heirachy3,
product heirachy 4 and
Materila group 4 total 8 fields
for the above mentioned fields when trying to create condition record in vk11
from drop down box I am not able to see data from customer heirarchy3-HIENR03(drop down box in condition record screen -vk11) field --?
whats wrong with that?
how to solve this issue?
thanks
krisSome one can help me on this issue.
thanks
kris -
Problem with leave to list-processing and return to screen
Hi all,
I am designing a screen in which I have provided a pushbutton which will allow the user to upload (via BDC) the price list to VK11 transaction. And consequently, after upload the BDC message will be captured and displayed as an ALV list. for this, I am using leave to list-processing and return to screen 100 statement.
My problem is, when I return from the alv list screen by pressing back/any button the called screen 100 is displayed as a dialog window. but actually the screen 100 is a normal screen.
How can I rectify this problem?
Thanks,
Rajanrajan,
i think the below link will clear your problem.
[http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9d2f35c111d1829f0000e829fbfe/frameset.htm]
Regards,
Venkat -
VK11/VK12: Automatically create anothercondition record upon saving
Hi,
First of all this is my first time to post a question here. I find every thread very helpful and other members helpful.
We came with a requirement to automatically create another condition record after the user clicks the save buttons. I'm not inclined in this module so to give you an idea in my requirement here are the following steps:
1. User go to VK11
2. Choose Selling Price List/Material access sequence
3. In the the screen the user enter a sales org, distribution channel, and price list.
Ex: Sales Organization: 0024
Distribution Channel: 00
Price List: 03
4. User enter in grid, material, amount, conditoin pricing unit.
Ex:
Material: 4668
Amount: 5,00
Condition Pricing Unit: 1
5. User click saves. Entries in tables KONH and KONP are populated. Condition record is saved
Now the requirement is create a duplicate conditoin record but with DIFFERENT price list-> 02 and amount. The new amount will be computed manually in the enhancement.
I did my part researching what can be done to solve this requirment. In the old threads, some suggest to use BADI BADI SD_COND_SAVE_A BADI. The problem is I am also not familiar in using BADI so I hope someone can tell me how I can learn BADI so I can implement the requirements. For the creation of condition records, I still have no idea how to do it.
So here are my current challenges:
1. How can I trap the save button in VK11/VK12. I am also thinking if all required validations were done prior to the creation to the conditoin record. I'm also thinking what are the things I should consider before creating a duplicate condition record with the different pricelist 03 and amount.
2. How can I create a condition records. Should I use a BAPI? I am also not familiar with BAPI
In addition to the requirement, I am thinking of some problems that might arise. I think there should be checking before creating the duplicate condition records. But I have no idea what are the things to consider.
I hope I explained my requirment clearly. Please feel free to ask for clarifications or question in my requirement. Thank you for your help. I really appreciate any help.
Thanks and God Bless.
-binaryghost
Edited by: binary ghost on Sep 9, 2010 10:46 AMHi,
Try these BTE'S:
BusTrEvent SAPMV13A OPEN_FI_PERFORM_00503301_BOST 00503301 Updating conditions (Pricing)).
BusTrEvent SAPLV13A-LV13AU02 OPEN_FI_PERFORM_00503301_E 00503301/P&S Update conditions (usage A)
BusTrEvent SAPLV130-LV130U01 OPEN_FI_PERFORM_00503302_E 00503302/P&S (Updating conditions (general)).
BusTrEvent SAPMV13A OPEN_FI_PERFORM_00503308_E 00503308/P&S Maintain conditions: Default condition (Condition Maintenance Control).
I hope this may helpfull.
Thank you,
Thanks,
AMS
Maybe you are looking for
-
Regular timeouts and slow system
Team, We are regularly getting timeouts for users on our IDES system. This is a dump of our ST02 screen: System: sap6ides_C10_00 Tune summary Date + Time of Snapshot: 18.08.2010 11:32:32 Startup: 20.04.2010 19
-
Revision: 10987 Author: [email protected] Date: 2009-10-13 20:54:31 -0700 (Tue, 13 Oct 2009) Log Message: Refactor MediaPlayer unit tests to make them injectable by MediaElement. Add additional unit tests for injecting various MediaElements int
-
I keep getting the error message below when trying to burn a slideshow. 140 mb on to a blank 4.7 gb dvd-r disc???? There was an error during rendering/encoding of the menus/slideshows. The burning process has been canceled.
-
Approval template not working on update
Dear All, I created an approval procedure to check line discounts >=25% on marketing documents. I used the below query; 'SELECT DISTINCT 'TRUE' WHERE $[$38.15.NUMBER]>=25' On Adding new marketing documents the approval works well, BUT if i recall the
-
Can i have multiple ActionServlet in a web Application?
Hi Can i have multiple ActionServlet in a web Application? if YES then please give me the sample configuration file.. thanks & Regards raghavan