Urgent help in va01 user exit
va01
userexit_check_vbap.
an idoc is coming from edi .
i need to read idoc and depending on condition of field value which is in idoc .
i need to pass a error log to some transation
how to read a idoc which is coming form edi
any sample code is help full
Hi Vijay,
There are a number of options depending upon your requirement but these are the things I would try (I don't have access to a system with inbound orders so cannot give conclusive answer).
1. Use userexits in inbound processing FM to transfer data to the application. In your case this will be IDOC_INPUT_ORDERS and CMOD exit VEDA0001 (FM EXIT_SAPLVEDA_011). This exit is called prior to to the BDC and contains all the data from the IDOC and the IDOC number. You could pass this data in a number of ways:
- import/export to memory
- use a common function group for all processing - place data into function group memory during EXIT_SAPLVEDA_011 and retrieve back in the sales userexits
2. The same processing FM IDOC_INPUT_ORDERS exports a flag to memory so you can detect in the sales userexits (da_edi_sign value SDEDI - see include LVEDAF01) - this will be useful for separating IDOC processing to other processing modes
3. Again using the userexit and the idoc number pass these to the application as in (1). You should then be able to call the IDOC function modules to read the IDOC content back (with something like FM IDOC_READ_COMPLETELY). Use this method if the data in the IDOC that you require is not parsed into the sales order tables
Hope this helps.
Thanks,
Pete
Similar Messages
-
Urgent help need for user exit
Hi all,
i have just did one user exit but in RSA3 field is not coming. in step 1 i modified the extract structure. in step 2 in added field in include program ,saved and activated it. but field is not coming in RSA3. can anyone plese help me what should i do now or what has went wrong.
in RSA3 update mode is 'F'
thanks in advancehi,
Have you created a project in CMOD and included your User exit component(RSAP0001) and activated it?.
check that. otherwise give some more details reg. your problem.
rgrds,
v.sen.
Message was edited by:
Senthilkumar Viswanathan -
Please help me with user-exits or baids for TCode : FOE2 & FOE1
Hi Experts
Please help me with user-exits or baids for TCode : FOE2 & FOE1.
I found these but not picking values from VIMI01,VIOB03 and VIOB41.
User-exits
FVCH0001 CH-specific enhancements: Esp. POR
ISRE0001 Determine bank procedure account no.
ISRE0002 IPD reporting data retrieval
Business Add-in
FVD_HANDLE_FORMULA Processing of Condition FormulasHi,
ASk your basis regarding the CI_CSKB table active issue, and first of all i dont see any table with the name CI_CSKB.
And check this exit-COOMKS03 whether it works for your screen exits.
Cheers!!
VEnk@
Edited by: Venkat Reddy on Nov 4, 2008 5:59 PM -
Use CREATE_TEXT on VA01 user exits
Hi,
I need to write item text using FM CREATE_TEXT in VA01 user exits. The FM required VBELN and I don't have when creating order.
How can I create item text in VA01 user exits ?
Thanks,
QuincyHi,
i have a similar requirement where i need to copy custom populated fields of vbap table into item->text->item notes tab.
i tried with both create_text and save_text. but i couldn't see the item in the item->texts->item notes.
here is my code:
CONCATENATE vbap-zzrelid vbap-zzsorg2 vbap-zzsorg3
vbap-zzsorg4 vbap-zzsorg5 vbap-zzsorg6
vbap-zzsorg7 vbap-zzsorg8 vbap-zzsorg9
vbap-zzsorg10 INTO gt_textname.
gt_textobject-tdid = c_0002.
gt_textobject-tdname = gt_textname.
gt_textobject-tdobject = c_vbbp.
gt_textobject-tdspras = sy-langu.
APPEND gt_textobject.
CONCATENATE 'relationship Owner:' vbap-zzrelid INTO gt_text-tdline
SEPARATED BY space.
APPEND gt_text.
CONCATENATE 'sales org 2 :' vbap-zzsorg2 INTO gt_text-tdline
SEPARATED BY space.
APPEND gt_text.
CONCATENATE 'sales org 3 :' vbap-zzsorg3 INTO gt_text-tdline
SEPARATED BY space.
APPEND gt_text.
CONCATENATE 'sales org 4 :' vbap-zzsorg4 INTO gt_text-tdline
SEPARATED BY space.
APPEND gt_text.
CONCATENATE 'sales org 5 :' vbap-zzsorg5 INTO gt_text-tdline
SEPARATED BY space.
APPEND gt_text.
CONCATENATE 'sales org 6 :' vbap-zzsorg6 INTO gt_text-tdline
SEPARATED BY space.
APPEND gt_text.
CONCATENATE 'sales org 7 :' vbap-zzsorg7 INTO gt_text-tdline
SEPARATED BY space.
APPEND gt_text.
CONCATENATE 'sales org 8 :' vbap-zzsorg8 INTO gt_text-tdline
SEPARATED BY space.
APPEND gt_text.
CONCATENATE 'sales org 9 :' vbap-zzsorg9 INTO gt_text-tdline
SEPARATED BY space.
APPEND gt_text.
CONCATENATE 'sales org 10 :' vbap-zzsorg10 INTO gt_text-tdline
SEPARATED BY space.
APPEND gt_text.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
header = gt_textobject
savemode_direct = 'X'
TABLES
lines = gt_text
EXCEPTIONS
id = 1
language = 2
name = 3
object = 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.
kindly resolve the problem with the above code.
Thanks,
Preethi. -
Help reqd for USER EXIT - VA01
Hi all,
i've the details of lists regarding the VA01 std enhancement assignment....but really i dont know which one'll be applicable for my USER Exit object....
My client requiremnet is...In VA01 or VA02
The enduser will be able to create/do the line items upto the line 4th (POSNR -004).means,we shuld restrict the line items as a maximum of 4 only and it has to throw an error if going for 5th line item and revert back to main .
which is the std enhancement/exit for this to declare in CMOD....the exact one
,i need.
If anyone has faced the same creiteria,then pls post ur comments here in detail,else if any knows the exit name,pls reply here on urgent basis.
my mail-id is [email protected]..for post ur comments thru mail.
thanks & regards
sankarTransaction Code - VA01 Create Sales Order
Exit Name Description
SDTRM001 Reschedule schedule lines without a new ATP check
V45A0001 Determine alternative materials for product selection
V45A0002 Predefine sold-to party in sales document
V45A0003 Collector for customer function modulpool MV45A
V45A0004 Copy packing proposal
V45E0001 Update the purchase order from the sales order
V45E0002 Data transfer in procurement elements (PRreq., assembly)
V45L0001 SD component supplier processing (customer enhancements)
V45P0001 SD customer function for cross-company code sales
V45S0001 Update sales document from configuration
V45S0003 MRP-relevance for incomplete configuration
V45S0004 Effectivity type in sales order
V45W0001 SD Service Management: Forward Contract Data to Item
V46H0001 SD Customer functions for resource-related billing
V60F0001 SD Billing plan (customer enhancement) diff. to billing plan
No of Exits: 15
USER EXIT
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.sapgenie.com/abap/code/abap26.htm
http://www.sap-img.com/abap/what-is-user-exits.htm
http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
http://www.easymarketplace.de/userexit.php
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.sappoint.com/abap/userexit.pdfUser-Exit
http://www.sap-img.com/ab038.htm
http://help.sap.com/saphelp_46c/helpdata/en/64/72369adc56d11195100060b03c6b76/frameset.htm
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.sap-img.com/abap/what-is-user-exits.htm
http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci982756,00.html
Rewards if useful.........
Minal -
VA01 user-exit to modify net price of line item...
Hello Experts,
Is there a user-exit to modify the net price value of a line item upon 'ENTERING' in
VA01 transaction?
Hope you can help me guys. Thank you and take care!Hi,
The user exits and badis for va01 tcode:
Enhancement/ Business Add-in Description
Enhancement
V45L0001
SD component supplier processing (customer enhancements)
V45E0002
Data transfer in procurement elements (PRreq., assembly)
V45E0001
Update the purchase order from the sales order
V45A0004
Copy packing proposal
V45A0003
Collector for customer function modulpool MV45A
V45A0002
Predefine sold-to party in sales document
V45A0001
Determine alternative articles for product selection
SDTRM001
Reschedule schedule lines without a new ATP check
V60F0001
SD Billing plan (customer enhancement) diff. to billing plan
V46H0001
SD Customer functions for resource-related billing
V45W0001
SD Service Management: Forward Contract Data to Item
V45S0004
Effectivity type in sales order
V45S0003
RP-relevance for incomplete configuration
V45S0001
Update sales document from configuration
V45P0001
SD customer function for cross-company code sales
Business Add-in
BADI_SD_SCH_GETWAGFZ
Scheduling Agreement: Read WAGFZ from S073
BADI_SD_V46H0001
SD Customer functions for resource-related billing
Pls. reward if useful... -
Hi all....
I got a new object in USER EXIT for my current impl project...
1st,i know that how to creat it in cmod but i desnt know how to do enhancement assignment and writing a code for the below requirement
my SD consultant req is......
IN VA01, the end user will able to enter(create std order) only 4 items(POSNR)
at a time as maximum....(should restrict it) and if while entering the 5th item,it throws an error msg and revert back it.....
the std program is "MV45AFZZ" ,here the enhancement assignment should be added in,inside the below sub-routine......as include program
"Form USEREXIT_SAVE_DOCUMENT_PREPARE"...
Endform..
Do u people know how to do it.....if anyone have done already...pls help on this by replying with sample codes and ur helps...
waiting for ur replies
thanks & regards
sankarHi,
These are standard enhancements available for VA01.
SDAPO001 Activating Sourcing Subitem Quantity Propagation
SDTRM001 Reschedule schedule lines without a new ATP check
V45A0001 Determine alternative materials for product selection
V45A0002 Predefine sold-to party in sales document
V45A0003 Collector for customer function modulpool MV45A
V45A0004 Copy packing proposal
V45E0001 Update the purchase order from the sales order
V45E0002 Data transfer in procurement elements (PRreq., assembly)
V45L0001 SD component supplier processing (customer enhancements)
V45P0001 SD customer function for cross-company code sales
V45S0001 Update sales document from configuration
V45S0003 MRP-relevance for incomplete configuration
V45S0004 Effectivity type in sales order
V45W0001 SD Service Management: Forward Contract Data to Item
V46H0001 SD Customer functions for resource-related billing
V60F0001 SD Billing plan (customer enhancement) diff. to billing plan
this can be checkit out in 'SMOD' and find out the user exits like screen, filed, funtionction exits etc under each enhancement which mentioned above.
Once if you find the user exit under one enhancement let suppose 'V60F0001' go to 'CMOD' and crete one project and click on create button.
then give the enhance ment name V60F0001 under the 'enhancement assign' componet
Then bydefault u will get all userexits available under this enhancement select one them a/c to your require ment press on one userexit and it enter the funtion exit and double click on 'INCLUDE' it ask to create press yes then write ur won code 'ACTIVATE' and come back and 'ACTIVATE' and come backe 'ACTIVATE' and come to initial screen ie 'CMOD' and press 'ACTIVATE' button.
this is the way how to create user exit.
There are some exit for checking order
User exits in the program MV45AFZZ :
USEREXIT_SAVE_DOCUMENT_PREPARE
Use this user exit to make certain changes or checks immediately before saving a document. It is the last possibility for changing or checking a document before posting.
The user exit is carried out at the beginning of the FORM routine BELEG_SICHERN.
User-Exits in program MV45AFZB :
USEREXIT_CHECK_VBAK
This user exit can be used to carry out additional checks (e.g. for completion) in the document header. The system could, for example, check whether certain shipping conditions are allowed for a particular customer group.
USEREXIT_CHECK_VBAP
This user exit can be used to carry out additional checks (e.g. for completion) at item level.
etc.
Look at User Exits in Sales Docuemnet Processing
<a href="http://">User Exits in Sales Docuemnet Processing</a>
<b>some of tips to find user exits :</b>
User Exits & Customer Exits :
User Exits: Executed with the help of user exits (these are subroutines reserved for customers that have been inserted in objects in the SAP namespace) 'hard-coded' at various points within SAP Repository objects.
Customer Exits :
1. Menu Exits: Menu exits add items to the pull down menus in standard SAP applications. You can use these menu items to call up your own screens or to trigger entire add-on applications. These special entries have function codes that begin with "+" (a plus sign).
2. Screen Exits: Screen exits add fields to screens in R/3 applications. SAP creates screen exits by placing special sub screen areas on a standard R/3 screen and calling a customer sub screen from the standard screens flow logic.
it is called by call customer- sub screen
3.Function Module Exits :Function module exits add functions to R/3 applications. Function module exits play a role in both menu and screen exits. When you add a new menu item to a standard pulldown menu, you use a function module exit to define the actions that should take place once your menu is activated. Function module exits also control the data flow between standard programs and screen exit fields.
it is called by Call Customer- function
Go to SMOD and press F4 where you will get the options of screen, menu, function exits.
Go to SE81 select the module which you want to check and find the enhancement.
In IMG (SPRO), search for enhancements in interested area.
Go to the program or transaction and search for CALL CUSTOMER-FUCTION or EXIT_<Progname>_nnn
For screen exits go to screen in SE51/SE80 search for- CALL CUSTOMER-SUBSCREEN..
<b>Reward with points if helpful.</b>
Regards,
Vijay -
VA01 user exit at line item with partner address
I need a user exit for VA01 that is at the line item level. The catch is I also need access to the partner address data. I have found userexit_pricing_prepare_tkomk (include MV45AFZZ) but that doesn't give you the "instance" address information (the address data that is specific to that order, after being changed). It only gives you the address number for the partner's default address.
Does anybody know if such an exit exists?
Regards,
AaronHi Aaron,
I had a similar requirement Long back & This was my code I written. Hope this helps you.
* Extract and Update field for partner-id - Goods Supplying vendor
CLEAR TKOMK-Y_GSVN.
PERFORM XVBPA_LESEN(SAPFV45K) USING 'WL' VBAP-POSNR SY-TABIX.
IF XVBPA-UPDKZ <> 'D'.
TKOMK-Y_GSVN = XVBPA-LIFNR.
ENDIF.
PERFORM XVBPA_LESEN(SAPFV45K) USING 'ZP' VBAP-POSNR SY-TABIX.
IF XVBPA-UPDKZ <> 'D'.
TKOMK-BSART = 'ZIN'.
SELECT SINGLE LAND1 FROM LFA1 INTO TKOMK-Y_COMM_CTY WHERE LIFNR = XVBPA-LIFNR.
ENDIF.
FORM XVBPA_LESEN USING US_PARVW US_POSNR US_TABIX.
DATA: DA_VBADR TYPE VBADR.
DATA: DA_VBPA LIKE XVBPA.
CLEAR DA_VBPA.
READ TABLE XVBPA INDEX 1 INTO DA_VBPA TRANSPORTING VBELN.
XVBPAKEY-MANDT = VBAK-MANDT.
XVBPAKEY-VBELN = DA_VBPA-VBELN.
XVBPAKEY-PARVW = US_PARVW.
XVBPAKEY-POSNR = US_POSNR.
READ TABLE XVBPA WITH KEY XVBPAKEY.
IF SY-SUBRC > 0.
XVBPAKEY-POSNR = POSNR_LOW.
READ TABLE XVBPA WITH KEY XVBPAKEY.
ENDIF.
IF SY-SUBRC > 0.
CLEAR XVBPA.
IF US_PARVW = 'WE'.
CLEAR KUWEV.
ENDIF.
IF US_PARVW = 'RG'.
CLEAR KURGV.
ENDIF.
ENDIF.
US_TABIX = SY-TABIX.
* CAM is not activated
IF ZAV_FLAG IS INITIAL.
IF NOT XVBPA-ADRNR IS INITIAL.
CLEAR XVBADR.
XVBADR-ADRNR = XVBPA-ADRNR.
READ TABLE XVBADR.
IF SY-SUBRC > 0.
CLEAR XVBADR.
ENDIF.
ENDIF.
* CAM is activated
ELSE.
*if there is an address
IF NOT XVBPA-ADRNR IS INITIAL.
*clear address data
CLEAR XVBADR.
*try to read address in internal table XVBADR
READ TABLE XVBADR WITH KEY ADRNR = XVBPA-ADRNR ADRNP = XVBPA-ADRNP.
*if address is not in internal table XVBADR
IF SY-SUBRC NE 0.
*read address in CAM tables
CALL FUNCTION 'SD_ADDRESS_GET'
EXPORTING
FIF_ADDRESS_NUMBER = XVBPA-ADRNR
FIF_PERSONAL_NUMBER = XVBPA-ADRNP
FIF_ADDRESS_INDICATOR = XVBPA-ADRDA
IMPORTING
FES_ADDRESS = DA_VBADR
EXCEPTIONS
OTHERS = 4.
IF SY-SUBRC EQ 0.
MOVE-CORRESPONDING DA_VBADR TO XVBADR.
APPEND XVBADR.
ELSE.
CLEAR XVBADR.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDFORM.
Thanks & Regards,
Dileep .C -
Doubt In VA01 User Exit........
Hi,
we are using <b>sap4.7.</b> In VA01 ( sales Order ) we have a tab called <b>additional data B</b>. where we can write our own user exit coding.
my doubt is where can i find <b>user exit</b> <b>enhancement</b>. i tried in <b>smod t.code</b> but i am not able to find. can any one tell me the enhancement name if you already done.
thank you,
Regards,
Saravanan.Check out this documentation.....
http://help.sap.com/saphelp_46c/helpdata/en/64/72369adc56d11195100060b03c6b76/frameset.htm
Under user exits>user exits in sales>user exits in sales document processing
Regards,
Rich Heilman -
Calling a screen in VA01 user exits
hi friends,
based on certain condition i neet to call custom module pool program from SD user exits in VA01.
Please suggest.. Pop up with values as in table control will also be OK..
thanksHi,
You need to create a custom module pool and call its screen on a suitable place. It is not clear what exactly is your problem.
There are more possibilities:
1.) You do not know how to create a module-pool
2.) You do not know how to call its screen in popup
3.) You do not know where to place your code for calling your screen
Solutions:
1.) Check chapter Dialog Programs: Overview in [BC - ABAP Programming|http://help.sap.com/printdocu/core/print46c/en/data/pdf/BCABA/BCABA.pdf]
2.) Check chapter Calling Modal Dialog Boxes in [BC - ABAP Programming|http://help.sap.com/printdocu/core/print46c/en/data/pdf/BCABA/BCABA.pdf]
3.) Look at subroutines in include MV45AFZZ and find the one that You are looking for. You can also check [User Exits In Sales Document Processing|http://help.sap.com/saphelp_46c/helpdata/en/1c/f62c7dd435d1118b3f0060b03ca329/content.htm]
If You need something more, be more specific.
Regards,
Adrian -
Hi
I have requirement to load values from a certain custom table into Sales Order Header & item data additional screens when I create the order by reference to quotation...
So for this reason I need to find a User Exit or BADI which will trigger before I enter into VA01 screen or after I click the create with reference button...
I was able to find the BADI BADI_SD_SALES_ITEM but it cannot modify the fields of VBAP
Please help me find the user exit which can modify the fields of VBAK and VBAP...Grame,
than you can use Include(Exit)MV45AFZZ and form
FORM USEREXIT_MOVE_FIELD_TO_VBAK
and
FORM USEREXIT_MOVE_FIELD_TO_VBAP
code should be like in above perform:
vbak-zzfield = xxxx-zzfield2.
VBAP-zzfield = xxxx-zzfield2.
Amit. -
Help with BDC, user exits and BAPI
Hello all:
1) I posted a question before about BDC documentation and people sent me lot of helpful material. Thanks to all of them. I am very new to ABAP coming from VB background and wondering if someone can tell me how to practice one simple BDC program starting from scratch. What do I first need to do to get started? I have Mini WAS 6.20 test version and like to practice BDC programming.
2) What are user exits and BADI and can anyone provide some documentation and sample code if possible.
Thanks everyone in advance.
--Mithun.Hai Mithun Dha
Go through the following Documentation & Example Code
Just check these links.
Diff. between LSMW & BDC?
BDC SESSION
CALL TRANSACTION
CALL DIALOG
What is BDC or batch input
The Batch Input is a SAP technic that allows automating the input in transactions. It lies on a BDC (Batch Data Commands) scenario.
BDC functions:
E BDC_OPEN_GROUP : Opens a session group
E BDC_CLOSE_GROUP : Closes a session
E BDC_INSERT : Insert a BDC scenario in the session
E The ABAP statement "CALL TRANSACTION" is also called to run directly a transaction from its BDC table.
It runs the program RSBDCSUB in order to launch automatically the session. The session management is done through the transaction code SM35.
The object itself is maintanable through the transaction SE24.
BDC methods:
Method
Description
Parameters
OPEN_SESSION
Opens a session
SUBRC (Return Code ? 0 OK)
SESSIONNAME (Session to be created)
CLOSE_SESSION
Closes a session
None
RESET_BDCDATA
Resets the BDC Internal Table...
None. Normally, for internal purposec
BDC_DYNPRO
Handles a new screen
PROGNAME (Name of the program)
DYNPRONR (Screen Number)
BDC_FIELD
Puts a value on the screen
FIELDNAME (Name of the field)
FIELDVALUE (Value to be passed)
CONSTRUCTOR
Constructor - Initializes NO_DATA
NODATA (No data character). The constructor is called automatically when the object is created.
RUN_SESSION
Launches a session with RSBDCBTC
None
CALL_TRANSACTION
Calls a transaction with the current BDC Data
MODE (Display Mode)
UPDATE (Update Mode)
TCODE (Transaction to be called)
BDC_INSERT
Inserts the BDC scenario in the session
TCODE (Transaction to be called)
BDC techniques used in programs:
1) Building a BDC table and calling a transaction,
2) Building a session and a set of BDC scenarios and keeping the session available in SM35,
3) Building a session and lauching the transaction right after closing the session.
BDC using Call Transaction
BDC using Call transaction involves calling an SAP transaction in back ground from within the ABAP
program. The process involves building an Internal BDC table containing the screen information needed to
execute the required transaction and then passing this to the Call transaction command (See code example).
The full procedure for creating a BDC program is as follows:
What is the difference between batch input and call transaction in BDC?
Session method.
1) synchronous processing.
2) can tranfer large amount of data.
3) processing is slower.
4) error log is created
5) data is not updated until session is processed.
Call transaction.
1) asynchronous processing
2) can transfer small amount of data
3) processing is faster.
4) errors need to be handled explicitly
5) data is updated automatically
BATINPUT/DIRECT INPUT
A: Batch-inputs can not be used to fill the "delivery due list" screen because it is not a dynpro. This is a standard SAP report. A SAP report (check with "System -> Status") may be called using SUBMIT sentence with the appropriate options . It is preferred to call a report than create a Batch-input program.
GO THROUGH THIS LINK
http://www.guidancetech.com/people/holland/sap/abap/zzsni001.htm
check with this code
include bdcrecx1.
tables : mara.
data : begin of it_mara occurs 0,
matnr like mara-matnr,
mbrsh like mara-mbrsh,
mtart like mara-mtart,
maktx like makt-maktx,
meins like mara-meins,
end of it_mara.
start-of-selection.
perform upload_data.
perform open_group.
loop at it_mara.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RMMG1-MATNR'
it_mara-matnr.
perform bdc_field using 'RMMG1-MBRSH'
it_mara-mbrsh.
perform bdc_field using 'RMMG1-MTART'
it_mara-mtart.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(02)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(02)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
perform bdc_field using 'MAKT-MAKTX'
it_mara-maktx.
perform bdc_field using 'BDC_CURSOR'
'MARA-MEINS'.
perform bdc_field using 'MARA-MEINS'
it_mara-meins.
perform bdc_field using 'MARA-MTPOS_MARA'
'NORM'.
perform bdc_transaction using 'MM01'.
endloop.
perform close_group.
*& Form upload_data
text
--> p1 text
<-- p2 text
FORM upload_data .
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'c:\mat_bdc.txt'
FILETYPE = 'ASC'
TABLES
DATA_TAB = it_mara.
IF SY-SUBRC = 0.
SORT IT_MARA BY MATNR.
ENDIF.
ENDFORM. " upload_data
flat file structure is
PRANIT_011 CCOUP This is Testing material kg
PRANIT_012 CCOUP This is Testing material kg
PRANIT_013 CCOUP This is Testing material kg
PRANIT_014 CCOUP This is Testing material kg
PRANIT_015 CCOUP This is Testing material kg
when your selecting views
this particular material will belongs to Po/Sales or some other areas .
when you select basic 1 --it gives description
select basic 2 -- it gives tax ,amount, base unit of measurement
BDC TO BAPI
The steps to be followed are :
1. Find out the relevant BAPI (BAPI_SALESORDER_CHANGE for VA02).
[for VA01 use BAPI_SALESORDER_CREATEFROMDAT2]
2. Create a Z program and call the BAPi (same as a Funtion module call).
2. Now, if you see this BAPi, it has
-> Importing structures.
eg: SALESDOCUMENT: this will take the Sales order header data as input.
-> Tables parameters:
eg: ORDER_ITEM_IN: this will take the line item data as input.
Note :
Only specify fields that should be changed
Select these fields by entering an X in the checkboxes
Enter a U in the UPDATEFLAG field
Always specify key fields when changing the data, including in the checkboxes
The configuration is an exception here. If this needs to be changed, you need to complete it again fully.
Maintain quantities and dates in the schedule line data
Possible UPDATEFLAGS:
U = change
D = delete
I = add
Example
1. Delete the whole order
2. Delete order items
3. Change the order
4. Change the configuration
Notes
1. Minimum entry:
You must enter the order number in the SALESDOCUMENT structure.
You must always enter key fields for changes.
You must always specify the update indicator in the ORDER_HEADER_INX.
2. Commit control:
The BAPI does not run a database Commit, which means that the application must trigger the Commit so that the changes are read to the database. To do this, use the BAPI_TRANSACTION_COMMIT BAPI.
For further details... refer to the Function Module documentation for the BAPi.
For User Exits
User Exits
Screen exits are exits that allow you to use a reserved part of the screen (A subscreen) to display or input data.
It is determined be SAP where the sub screen will be displayed.
The syntax is: CALL CUSTOMER-SUBSCREEN
The screen exit is not processed untill the corresponding subscreen has been created in an enhancement project,
and the project has been activated.
Note:
Function codes are only processed in the main screens flow logic
You are not allowed to enter a name for the subscreens command field
You are not allowed to define GUI stauses
You are not allowed to enter a value for Next screen
The global data of the program is not available for the subscreen. Data for the subscreen is provided by function modules.
These function modules belongs to the same function group as the subscreen Subscreens are edited with transaction CMOD.
When you activate a project containg subscreens, the calling screen is regenerated and the subscreen is displayed next
time you display the calling screen
The developer must create the subscreen and the corresponding PBO and PAI modules
How to identify screen exits
Look after CALL CUSTOMER-SUBSCREEN in the screenprogram of the screen you want to modify.
Use transaction CMOD menu Utillities -> SAP enhancements to search for screen exits
MENU EXITS
Menu exits allow you to add your own functionallity to menus. Menu exits are implemented by SAP, and are reserved menu
entries in the GUI interface. The developer can add his/her own text and logic for the menu.
Function codes for menu exits all start with "+"
Example
We want to create a new menu item in the Office menu. The text for the menu should be "Run ZTEST", and the menu will
run report ZTEST.
Goto transaction SE43 Area Menu Maintenance
In Area Menu Paramenter type 'S000' (S triple Zero)
Select Change and ignore all the warning screens
Expand the office menu. In the buttom of the office tree you will find a menu named "Customer function"
Double click on the text. In the pop-up screen change the text to "Run ZTEST". Note that the trsnaction code is +C01
Goto transaction SE93 and create transaction +C01 that calls report ZTEST.
Now you will se the menu displayed in the office tree. If you delete transaction +C01 again, the new menu will dissapear.
USER EXITS
User exits (Function module exits) are exits developed by SAP. The exit is implementerd as a call to a functionmodule.
The code for the function module is writeen by the developer. You are not writing the code directly in the function module,
but in the include that is implemented in the function module.
The naming standard of function modules for functionmodule exits is: EXIT_<program name><3 digit suffix>
The call to a functionmodule exit is implemented as: CALL CUSTOMER.-FUNCTION <3 digit suffix>
Example:
The program for transaction VA01 Create salesorder is SAPMV45A
If you search for CALL CUSTOMER-FUNCTION i program SAPMV45A you will find ( Among other user exits):
CALL CUSTOMER-FUNCTION '003'
exporting
xvbak = vbak
xvbuk = vbuk
xkomk = tkomk
importing
lvf_subrc = lvf_subrc
tables
xvbfa = xvbfa
xvbap = xvbap
xvbup = xvbup.
The exit calls function module EXIT_SAPMV45A_003
2. How to find user exits
Display the program where you are searching for and exit and search for CALL CUSTOMER-EXIT
If you know the Exit name, go to transaction CMOD. Choose menu Utillities->SAP Enhancements.
Enter the exit name and press enter.
You will now come to a screen that shows the function module exits for the exit.
3. Using Project management of SAP Enhancements
We want to create a project to enahance trasnaction VA01
Go to transaction CMOD
Create a project called ZVA01
Choose the Enhancement assign radio button and press the Change button
In the first column enter V45A0002 Predefine sold-to party in sales document . Note that an enhancement can only
be used i 1 project. If the enhancement is allready in use, and error message will be displayed
Press Save
Press Components. You can now see that enhancement uses user exit EXIT_SAPMV45A_002. Double click on the exit.
Now the function module is displayed. Double click on include ZXVVAU04 in the function module
Insert the following code into the include: E_KUNNR = '2155'.
Activate the include program. Go back to CMOD and activate the project.
Goto transaction VA01 and craete a salesorder. Note that Sold-to-party now automatically is "2155"
Have look at this links
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIOFFI/BCCIOFFI.pdf
http://www.sapgenie.com/abap/ole.htm
http://help.sap.com/saphelp_46c/helpdata/en/59/ae3f2e488f11d189490000e829fbbd/frameset.htm
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIOFFI/BCCIOFFI.pdf
Creation of Field Exits
Step by step procedure for creating Field Exits
There are eight steps to creating a field exit:
Step 1: Determine Data Element
Step 2: Go To Field Exit Transaction
Step 3: Create Field Exit
Step 4: Create Function Module
Step 5: Code Function Module
Step 6: Activate Function Module
Step 7: Assign Program/Screen
Step 8: Activate Field Exit
Step 1: Determine Data Element
- Before you can begin adding the functionality for a field exit, you must know the corresponding data element.
- An easy way to determine the data element associated to a particular screen field is to:
Go the appropriate screen.
Position the cursor in the appropriate field.
Press eF1f for field-level help.
Click on the eTechnical infof pushbutton (or press eF9f) on the help dialog box.
On this Technical Information dialog box, the data element will be specified if the field is 'painted' from the ABAP/4 Dictionary.
Step 2: Go To Field Exit Transaction
- The transaction to create field exits is CMOD.
- You can use the menu path Tools -> ABAP/4 Workbench -> Utilities -> Enhancements -> Project management.
- From the initial screen of transaction CMOD, choose the Text enhancements -> Field exits menu path.
- After choosing this menu path, you will be taken to the field exits screen. From here, you can create a field exit.
NOTE : Even though you use transaction CMOD to maintain field exits, you do not need to create a project to activate field exits.
Step 3: Create Field Exit
- From the field exit screen of transaction CMOD, choose the Field exit -> Create menu path.
- After choosing this menu path, a dialog box will prompt you for the appropriate data element .
- Enter the data element name and click the eContinuef pushbutton.
- Now, you will be able to create the function module associated to the data elementfs field exit.
Step 4: Create Function Module
- You will automatically be taken to the Function Library (SE37) after entering a data element name and clicking the eContinuef pushbutton.
- In the eFunction modulef field, a function module name will be defaulted by the system based on the data element specified. This name will have the following convention:
FIELD_EXIT_<data element>
- You can add an identifier (an underscore followed by a single character ).
- The first function module for a data elementfs field exit must be created without an identifier.
- To create the function module, click on the eCreatef pushbutton, choose menu path Function module -> Create, or press eF5f.
- After choosing to create the function module, you will get the warning: "Function module name is reserved for SAP". This message is just a warning so a developer does not accidentally create a function module in the field exit name range. By pressing eEnterf, you will be able to go ahead and create the function module.
- Before coding the function module, you will have to specify the function modules attributes -- function group, application, and short text.
Step 5: Code Function Module
- From the function modulefs attributes screen, click on the eSource codef pushbutton or choose the Goto -> Function module menu path to the code of the function module.
- Here you will add your desired functionality for the field exit.
- Remember that field exitfs function module will have two parameters -- one importing parameter called "INPUT" and one exporting parameter called "OUTPUT". These parameters will be set up automatically by the system.
- You must remember to assign a value to the OUTPUT field. Even if the value does not change, it must be moved from the INPUT field to the OUTPUT field.
Step 6: Activate Function Module
- After coding the function module, you must remember to activate it.
- Use the Function module -> Activate menu path to activate the function module.
- At this point, you can return to the field exit transaction.
- You should be able to 'green arrow' back to this transaction.
- When you return to the field exit transaction, you will see an entry for the newly created field exit.
- At this point, the field exit is global. That is, it applies to all screens that use a particular data element. On any screen that uses the data element, the corresponding field exit function module will be triggered, once it is active.
- Also, the field exit will not be triggered yet because it is inactive.
Step 7: Assign Program/Screen
- This step is only needed if you want to make a field exit local.
- To make a field exit local, select the field exit and click on the eAssign prog./screenf pushbutton.
- In the dialog box , indicate the appropriate program name and screen number.
This information indicates that the field exit is local to the specified screen in the specified program.
- In the dialog box, you determine which function module gets executed for the field exit by specifying the identifier in the eFld. Exitf field.
- If this field is left blank, the function module triggered will be 'FIELD_EXIT_<data element>'.
- If a single-character identifier is entered into the field, the function module triggered will be 'FIELD_EXIT_<data element>_<identifier>'.
Step 8: Activate Field Exit
- The field exit must be active for it to be triggered by the system.
- Activate the field exit by choosing the Field exit -> Activate menu path.
- After assigning the field exit to a change request, its status will change to eActivef and it will be triggered automatically on the appropriate screen(s).
NOTE : In order to activate the field exit the profile parameter abap/fieldexit = YES must be set on all application servers
Thanks & regards
Sreenivasulu P -
VA01 user-exit for external price
I have a little bit hard question,
I want to know if anybody have already do thing like that :
We need to find a user-exit to the VA01, VA02, for each time I press enter to a line. This user-exit will call a RFC function to an other system to get the price of the material number.
After getting the price, the user-exit must modify the price of the item.
Any help will be welcome
FrédéricHi Wolfgang,
No I can't, in fact, the price depend of the number of items, the kind of item, the customer, the vendor ....
So, I really need each time, that this kind of order will be created to send all the informations to an external system, and get back the price.
I'm agree with you with the disastrous time that will cost. But, I have not really the choice.
And the more funy, after this, I need to modify a purchase order with special price too
A friend from SAP, advice me to do this in background job. But, I think, I will need to answer before to my customer and boss, that's possible ... but cost too much time.
My question, for the moment, is : Is it possible to modify the price of all the items of an order, in an user-exit/badi, when I save my order ? -
Need help in PBEN0011 user exit
Hello Experts,
I am using EXIT_SAPLHRBEN00GENERAL_011 FM of PBEN0011 user exit to calculate the coverage amount.But in my requirement i have to calculate that based on the PA0008-TRFST(pay scale level).But in this user exit there is pernr field in import parameters.
I need perner to read the pay scale level for that employee.
Please help...is there any way to access the screen fileds like pernr ,begda,endda in the user exit if they are being passed to the user exit.
Thanks in advance..
ShwetaHello All,
I want to copy all queries under one infoset and user group to new infoset.I tried copying using copy function vaialable in goto menu.But it is giving error for the query having varian.
I am unable to copy the queries with variants. And I am getting following message:
Error when copying query report XXXXXXX= with variants. Error when importing query
Please help...
Thank you in advance
Shweta -
Help required regarding user exit for STPSHH01 IDOC
Need help regarding user exit.
I append the structure of VTTP and add one field with the name of ZDELCST i.e Delivery cost so i want to update that table once the idoc will post.
I have to write the user exit for this but i have no idea how to do this so kindly requesting someone to please write the code for me and i will be very grateful to him/her.
The functional module is IDOC_INPUT_SHIPPL
and there is a CALL CUSTOMER-FUNCTION '012'
this will take us to function module EXIT_SAPLV56I_012
This includes ZXV56U08
Within this include in need to map the delivery cost from the idoc to the new append filed VTTP-ZDELCSTHi,
use this FM to update ur shipment
variables
DATA: lo_tp_g_tra TYPE v56e_shipment_activities, "Data to modify
lo_tp_g_shp TYPE v56e_shipment,
lo_tp_g_log TYPE v56e_logfile, " Errors function
call the function to modify shipments
CALL FUNCTION 'SD_SHIPMENT_PROCESS'
IMPORTING
e_logfile = lo_tp_g_log
CHANGING
c_activities = lo_tp_g_tra
c_shipment = lo_tp_g_shp
EXCEPTIONS
error = 1
OTHERS = 2.
Thanks,
Sendil.
Maybe you are looking for
-
I am from Ireland and bought the majority of my itunes library in the Irish store before I moved to the UK. The account is still the same however the country in which I am using itunes store is now different (e.g. I was using the Irish store with an
-
Anyone know if all the features of the Harman Kardon Go+Play work with the iphone. will I dock the phone, does the video out function work. If anybody has the Iphone and these speakers or has any more info please help.
-
I try to open itunes but a mistake keeps apearing i tunes new library
I try to open i tunes but a mistake messages keeps apearing, " i tunes new library .
-
Script of ungrouping and unlocking page items in layers.
Hi, Do you have any scripts for script of ungrouping and unlocking page items in layers. thanks rajnikanh
-
Divide the internal table for months
How to divide the internal table itab for the months? I have a field data in internal table itab and now i have need to divide itab in n table for months. The data interval is max 4 months. Sorry for my english. ex. itab. data: begin of itab occurs 0