BAdI for change Material Description
hi all experts
can i use <u><b>BAdI</b></u>, how i do that.
please tell me the steps..
i would like to allow or disallow to change material description in short text field at follow t-code ::
ME51N Create Purchase Requisition
ME52N Change Purchase Requisition
ME21N Create Purchase Order
ME22N Change Purchase Order
IW31 Create Maintenance Order
IW32 Change Maintenance Order
CJ20N Project Builder
thanks
Step 1.
Search the SDN Forums with keywords like "ME52N" "ME21N" "BADI" etc, and look at all the examples already posted.
Andrew
Similar Messages
-
BAPI needed for change material(Transaction : MM02)
Hi all,
We have a requirement where in we need to post the documents throuh BAPI for change material (Transaction: MM02).
Any inputs on this..is highly appreciable...
thanks in advance...
regards..
prathima.CHECK THIS CODE
*& Report ZBAPI_MATERIAL_SAVEDATA
REPORT ZBAPI_MATERIAL_SAVEDATA NO STANDARD PAGE HEADING MESSAGE-ID (ZHNC).
TYPES:BEGIN OF TY_MAT,
MATERIAL(4),
IND_SECTOR(1),
MATL_TYPE(4),
MATL_GROUP(9),
BASE_UOM(3),
BASE_UOM_ISO(3),
PLANT(4),
DEL_FLAG(1),
PUR_GROUP(3),
BASE_QTY(13),
STGE_LOC(4),
MRP_IND(1),
SALES_ORG(4),
DISTR_CHAN(2),
DEL_FLAG1(1),
MIN_ORDER(13),
LANGU(2),
MATL_DESC(40),
END OF TY_MAT.
DATA: IT_DATA TYPE TABLE OF TY_MAT,
WA_DATA LIKE LINE OF IT_DATA.
*decalraing flag
data: v_flag value ''.
*DECLARING WORK AREAs TO BE PASSED TO THE FUNCTION MODULE.
DATA: BAPI_HEAD LIKE BAPIMATHEAD,
BAPI_CLIENTDATA LIKE BAPI_MARA,
BAPI_CLIENTDATAX LIKE BAPI_MARAX,
BAPI_PLANTDATA LIKE BAPI_MARC,
BAPI_PLANTDATAX LIKE BAPI_MARCX,
BAPI_STORAGELOCATIONDATA LIKE BAPI_MARD,
BAPI_STORAGELOCATIONDATAX LIKE BAPI_MARDX,
BAPI_SALESDATA LIKE BAPI_MVKE,
BAPI_SALESDATAX LIKE BAPI_MVKEX,
BAPI_MAKT LIKE BAPI_MAKT,
BAPI_RETURN LIKE BAPIRET2.
*INTERNAL TABLE TO HOLD THE MATERIAL DESCRIPTION
DATA: BEGIN OF IT_MAKT OCCURS 0.
INCLUDE STRUCTURE BAPI_MAKT.
DATA END OF IT_MAKT.
DATA:BEGIN OF IT_RET OCCURS 0.
INCLUDE STRUCTURE BAPIRET2.
DATA END OF IT_RET.
*INTERNAL TABLE TO HOLD HEADER DATA
DATA: IT_EXCEL TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
*SELECTION-SCREEN ELEMENTS
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETER: FNAME TYPE RLGRAP-FILENAME OBLIGATORY DEFAULT 'C:\Documents and Settings\Administrator\Desktop\MATMAS.XLS' .
PARAMETERS: P_BEGCOL TYPE I DEFAULT 1 NO-DISPLAY,
P_BEGROW TYPE I DEFAULT 1 NO-DISPLAY,
P_ENDCOL TYPE I DEFAULT 100 NO-DISPLAY,
P_ENDROW TYPE I DEFAULT 32000 NO-DISPLAY.
SELECTION-SCREEN END OF BLOCK B1.
*DECLARATION OF EXCELAL TABLE
AT SELECTION-SCREEN ON VALUE-REQUEST FOR FNAME.
PERFORM F_GET_FILE USING FNAME.
START-OF-SELECTION.
PERFORM F_XLS_ITAB USING FNAME
CHANGING IT_EXCEL.
PERFORM F_MOVE_DATA.
perform F_GET_DATA.
*& Form F_GET_FILE
text
-->P_FNAME text
<--P_SY_SUBRC text
FORM F_GET_FILE USING P_FNAME LIKE FNAME.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
PROGRAM_NAME = SYST-REPID
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
STATIC = ' '
MASK = ' '
CHANGING
FILE_NAME = P_FNAME
EXCEPTIONS
MASK_TOO_LONG = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE E006(ZHNC).
ENDIF.
ENDFORM. " F_GET_FILE
*& Form F_XLS_ITAB
text
-->P_FNAME text
<--P_IT_EXCEL text
FORM F_XLS_ITAB USING P_FNAME
CHANGING P_IT_EXCEL.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = FNAME
I_BEGIN_COL = P_BEGCOL
I_BEGIN_ROW = P_BEGROW
I_END_COL = P_ENDCOL
I_END_ROW = P_ENDROW
TABLES
INTERN = IT_EXCEL
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3
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_XLS_ITAB
*& Form F_MOVE_DATA
text
--> p1 text
<-- p2 text
FORM F_MOVE_DATA .
DATA : LV_INDEX TYPE I.
FIELD-SYMBOLS <FS>.
*--- Sorting the internal table
SORT IT_EXCEL BY ROW COL.
CLEAR IT_EXCEL.
LOOP AT IT_EXCEL.
MOVE IT_EXCEL-COL TO LV_INDEX.
*--- Assigning the each record to an internal table row
ASSIGN COMPONENT LV_INDEX OF STRUCTURE WA_DATA TO <FS>.
*--- Asigning the field value to a field symbol
MOVE IT_EXCEL-VALUE TO <FS>.
AT END OF ROW.
APPEND WA_DATA TO IT_DATA.
CLEAR WA_DATA.
ENDAT.
ENDLOOP.
ENDFORM. " F_MOVE_DATA
*& Form F_GET_DATA
text
--> p1 text
<-- p2 text
FORM F_GET_DATA .
LOOP AT IT_DATA INTO WA_DATA.
MOVE-CORRESPONDING WA_DATA TO BAPI_HEAD.
BAPI_HEAD-BASIC_VIEW ='X'.
BAPI_HEAD-SALES_VIEW ='X'.
BAPI_HEAD-PURCHASE_VIEW ='X'.
BAPI_HEAD-STORAGE_VIEW ='X'.
MOVE-CORRESPONDING WA_DATA TO BAPI_CLIENTDATA.
BAPI_CLIENTDATAX-MATL_GROUP = 'X'.
BAPI_CLIENTDATAX-BASE_UOM = 'X'.
BAPI_CLIENTDATAX-BASE_UOM_ISO = 'X'.
MOVE-CORRESPONDING WA_DATA TO BAPI_PLANTDATA.
BAPI_PLANTDATAX-PLANT = BAPI_PLANTDATA-PLANT.
BAPI_PLANTDATAX-DEL_FLAG = 'X'.
BAPI_PLANTDATAX-PUR_GROUP = 'X'.
BAPI_PLANTDATAX-BASE_QTY = 'X'.
MOVE-CORRESPONDING WA_DATA TO BAPI_STORAGELOCATIONDATA.
BAPI_STORAGELOCATIONDATA-PLANT = BAPI_PLANTDATA-PLANT.
BAPI_STORAGELOCATIONDATAX-PLANT = BAPI_STORAGELOCATIONDATA-PLANT.
BAPI_STORAGELOCATIONDATAX-STGE_LOC = BAPI_STORAGELOCATIONDATA-STGE_LOC.
BAPI_STORAGELOCATIONDATAX-MRP_IND = 'X'.
MOVE-CORRESPONDING WA_DATA TO BAPI_SALESDATA.
BAPI_SALESDATAX-SALES_ORG = BAPI_SALESDATA-SALES_ORG.
BAPI_SALESDATAX-DISTR_CHAN = BAPI_SALESDATA-DISTR_CHAN.
BAPI_SALESDATAX-DEL_FLAG = BAPI_SALESDATA-DEL_FLAG.
BAPI_SALESDATAX-MIN_ORDER = 'X'.
REFRESH IT_MAKT.
IT_MAKT-LANGU = WA_DATA-LANGU.
IT_MAKT-MATL_DESC = WA_DATA-MATL_DESC.
APPEND IT_MAKT.
CLEAR IT_RET.
REFRESH IT_RET.
PERFORM F_CALL_BAPI.
READ TABLE IT_RET WITH KEY TYPE = 'S'.
IF SY-SUBRC EQ 0.
PERFORM F_BAPI_COMMIT.
WRITE:/ 'MATERIAL CREATED OR UPDATED SUCESSFULLY WITH MATERIAL NO',WA_DATA-MATERIAL.
ELSE.
MESSAGE E000(ZHNC) WITH 'ERROR IN CREATING THE MATERIAL'.
*WRITE: / 'ERROR IN CREATIN MATERIAL',IT_RET-MESSAGE.
*PERFORM F_DOWNLOAD.
ENDIF.
*ENDIF.
ENDLOOP.
ENDFORM. " F_GET_DATA
*& Form F_CALL_BAPI
text
--> p1 text
<-- p2 text
FORM F_CALL_BAPI .
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
HEADDATA = BAPI_HEAD
CLIENTDATA = BAPI_CLIENTDATA
CLIENTDATAX = BAPI_CLIENTDATAX
PLANTDATA = BAPI_PLANTDATA
PLANTDATAX = BAPI_PLANTDATAX
STORAGELOCATIONDATA = BAPI_STORAGELOCATIONDATA
STORAGELOCATIONDATAX = BAPI_STORAGELOCATIONDATAX
SALESDATA = BAPI_SALESDATA
SALESDATAX = BAPI_SALESDATAX
IMPORTING
RETURN = IT_RET
TABLES
MATERIALDESCRIPTION = IT_MAKT
UNITSOFMEASURE =
UNITSOFMEASUREX =
INTERNATIONALARTNOS =
MATERIALLONGTEXT =
TAXCLASSIFICATIONS =
RETURNMESSAGES =
PRTDATA =
PRTDATAX =
EXTENSIONIN =
EXTENSIONINX =
APPEND IT_RET.
ENDFORM. " F_CALL_BAPI
*& Form F_BAPI_COMMIT
text
--> p1 text
<-- p2 text
FORM F_BAPI_COMMIT .
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT =
IMPORTING
RETURN =
ENDFORM. " F_BAPI_COMMIT -
BADI for changing product catgory
Hello SRM Experts,
I am looking for an BADI for changing product category.
We use classic scenario with an external catalog. Our supplier delievers us some data. Some of this data are used for statitical reason for example new item matgroup from oci interface.
now I want to determine the product categorie in relation to the delivered new item matgroup.
I have found some BADI to manipulate the Data - but not possible for product category. Thank your for help
Regards UweHello Yann,
I have activated this BADI already. But I have not managed it to change product category.
Which field of this BADI has to be changed ?
Where do I get the GUID from ?
thank you -
BADI for changing Appraisal document application name for Web dynpro ABAP
Hi,
For Appraisal document customizing through PHAP_CATALOG_PA, We have BADI HRHAP00_BSP_TMPL to change the BSP application name which can be used in Web layout for output display. Using this we can change application name from HAP_DOCUMENT to custom BSP application name
Similarly, what is the BADI for changing Web dynpro ABAP applictaion name? Currently its triggering HAP_MAIN_DOCUMENT.
how do we change application name to some custom web dynpro application name
Regards,
KothandHi Karim,
I don't know, if there is any chance to get the Webdynpro application name. At least in the ABAP System fields is no information about the webdynpro application name.
One remark: I have allways problems with BAPIS / BADIS that behave different depending on the caller. Could it be a good idea to pass some information through the interface / parameters?
Best regards
Renald -
Change Material description by z report
Dear Freinds,
I want to change material description ,SHORT DESCRIPTION by zreport screen without using any excel or text file, please help me out .
Thanks
NaveenHi,
Make those fields what ever user wants to enter in the selection screen aslo the field which you want to change by user.
When ever user clcik on execute then they should get message by saying that "Description is changed".
Code:
1. create one work area type table of MARA.
2. fetch the single record form MARA into that structure where table entries = user inputs
3. map the description field with user entered field to be change
4. Unlock the table
5. modify the table from work area
6. Lock the table.
7. Pass the message.
---Naveen Inuganti. -
BADI for MIGO ( Material document change for Production Order goods Receipt
Hey experts,
I am actually stuck up with MIGO BADI.
There are many BADI's available but i dont think any one would suit my requirement.
here goes my requirement.
When a Production Order is created in transaction CO01 , the system picks the value of the moving material and multiplies it with the quantity .
But when the production order is being confirmed thru CO11N , again the system picks the present moving price of the material and multiplies it with the quantity. This goods receipt is done through MIGO transaction by selecting goods receipt for order that is 101 movement type. I have been asked to get the value of the material at the time of production order create and then change the dmbtr value of MSEG table, this can be done in the badi at the time of creation of material document number but the BADI's MB_DOCUMENT_BEFORE_UPDATE, MB_DOCUMENT_UPDATE do not allow me to change the values .
The BADI MB_DOCUMENT_BEFORE_UPDATE does not allow any changes to be made for XMSEG table
and MB_DOCUMENT_UPDATE is passed by value and hence the changes are not affected after it comes out of the method.
Guys please help me as this creating a hell lot of problem here and i would surely reward the max points if answered.
here is the example to be more precise.
Material : Pen
Quantity : 10.
date : 01.06.2008.
TYransaction co01.
lets say at the time of creation the value of the material was 5 rs
a material document would be created with the value : 50 rs.
Now for this prod. order goods receipt is being done on 01.07.2008.
Let the value be 4 rs now.
so the Material document would be created with a value of 40 rs.
I need to make this 50 rs.
I have got all the data to do it but i am not gettin the coreect BADI, i just want the BADI name to change the DMBTR value at the time of creation of material Document.
Thanks in Advance.User-exit /BADI to change mseg during migo
https://forums.sdn.sap.com/click.jspa?searchID=-1&messageID=5435559
try this links -
Change material description in MM02
Hi,
System is allowing to change the material description in MM02 from any views.
Requirement is once the material code save, system should allow to change the description of product to user who have authorisation for Basic data 1 and 2 not other views.
Like I am giving Accounting view authorisation to one person, he should not able to change the product description.
Is it possibel and how?
Thanks,
Samir BhattHi,
Description is part of MARA table. If you give full authorization for General data fields to the persons that maintain basic 1 & 2 and does not give this authorization to the persons that are not allowed to change the description, you will achieve what you want. This will allow the financial people to see the general data fields but they will not be able to change them.
Regards,
MdZ -
Badi for changing Stock type in MIGO transaction
Hello ALL,
IS there any BADI or EXIT for changing stock type in MIGO when we are doing GR against PO then we need to change the Stock type to Unrestricted stock.
Please let me know.Awarded if useful.
Regardshi,
Look into the BADI MB_MIGO_BADI.
or
Exits:
MBCF0009 Filling the storage location field
MBCF0005 Material document item for goods receipt/issue slip
MBCF0006 Customer function for WBS element
MBCF0007 Customer function exit: Updating a reservation
MBCF0010 Customer exit: Create reservation BAPI_RESERVATION_CREATE1
MB_CF001 Customer Function Exit in the Case of Updating a Mat. Doc.
MBCF0002 Customer function exit: Segment text in material doc. item
MBCF0011 Read from RESB and RKPF for print list in MB26
Sirish -
Change material description at plant level
Hi,
can material description be changed for only one plant.Hi All,
Material Description is at client level data it will be applicable for all plants. But if you extend the material for using it in the other plant you can make a note in the sale text or purchase order text.
Hope this will solve your problem,
Regards,
Pherasath -
Reg. Exit/BADI for changing item data of PO in ME22N
Hi all,
My requirement is to update the field LABNR (Order Ack.) of few specific line items of a PO, in the Transaction ME22N, using Exit/BADI.
I have tried the BADI ME_PROCESS_PO_CUST. But the PROCESS_ITEM method of this BADI processes only the line item which has been changed/inserted in ME22N transaction. But my requirement is to update line items irrespective of whether that line item was "changed/not changed" during the process in ME22N screen.
Could you please suggest me some suitable Exit/BADI for this requirement.
Regards,
Anbarasan KThanks Martin.
Problem solved by implementing the method Process_Header.
1. Get the items from Header - im_header->get_items
2. Loop the item list and get the line item record - re_item-item->get_data
3. <- Logic to Update the line item - >.
4. Update the line item - re_item-item->set_data
Thank you very much.. Martin.
Regards,
Anbarasan K -
User Exit/ Badi for Changing Quant parameters during TO Creation
Hi Gurus,
Could you please guide me to advice the User Exit/Badi which can be used for changing Quant Data during TO Creation.
User Requirement: Using "Recepient Field" in MIGO as a Key Value for FIFO in WM during goods issue. Receipient is copied into TR and TO (Standard SAP Functionality). For the purpose of Stock Removal based on Receipient Value, we need to copy this value into Quant Data field named Certificate Number ("LQUA-ZEUGN").
I will highly appreciate reply from Gurus.
Regards,
Gupta MHi manish,
Use the Exit MWMTO001 for this purpose and modify the table accordingly. This will solve your problem.
Thanks,
Shibashis -
#(hash) sign printed out for spaces material description in PO
Hi All,
I have problem with my sapscript form for PO, when preview, the material description is ok
but when print out, the space between the word of the material description become # sign like
Leif#Eriksson#1oz#Silver#Coin###, this not happen to all item, only for certain material.
When checked, these material are not created manually in system but is uploaded by BDC.
In material master screen, there are no #sign either.
Any solution or what should I check ?
ThanksWell, as you've probably discovered by searching the forums, the # is a substitution for an unprintable character. I would look at the data value in debug, convert that to a hex value with a chart, and see what needed to be done to either clean up the data values or substitute a space for whatever character(s) the # values represent in the output.
-
User exit / substiution / badi for changing baseline date
Dear Experts ,
I have a requirement to change the base line date of residual document created in F-28 / F-32 to the base line date of original document getting partially cleared .
I have explored the option of substitution but it doesnt work as field ZBLDT is not available for substitution there .
Please let me know any BADI / Exit which can perform this change of baseline date .
thanks in advanceHi Milind,
Following are the user-exits for F-32 :
RFAVIS01 Customer Exit for Changing Payment Advice Segment Text
RFEPOS00 Line item display: Checking of selection conditions
RFKORIEX Automatic correspondence
SAPLF051 Workflow for FI (pre-capture, release for payment)
F050S001 FIDCMT, FIDCC1, FIDCC2: Edit user-defined IDoc segment
F050S002 FIDCC1: Change IDoc/do not send
F050S003 FIDCC2: Change IDoc/do not send
F050S004 FIDCMT, FIDCC1, FIDCC2: Change outbound IDoc/do not send
F050S005 FIDCMT, FIDCC1, FIDCC2 Inbound IDoc: Change FI document
F050S006 FI Outgoing IDoc: Reset Clearing in FI Document
F050S007 FIDCCH Outbound: Influence on IDoc for Document Change
F180A001 Balance Sheet Adjustment
FARC0002 Additional Checks for Archiving MM Vendor Master Data
I hope this will help you.
Regards,
Nitin. -
User exit/Badi for changing operation work center based on service product
Hi,
I have an requirement to change the operation work center based on the service product in IW31/IW32 transaction. I am using the BAdi 'IM_SM_BADI_READT399A' for changing the main work center. It changes all the operation work centers except the first one. But I need to change it all the operations.
Thanks in Advance.I am using the enhancement spot 'IWO1_TL_INTEGRATION2' for changing the first operation work center
-
Functional Module or BAPI for changing Material Type
Hi,
There is a Transaction MMAM for changing the Material Type in SAP. Can anyone help me in figuring out a Functional Module which can change the Material Type like how MMAM transaction does. Is anyone aware of any FM or BAPI that can take import parameters as Material Number and New Material Type and change the material type to the New one.
I tried using the BDC but got some performance issues with it.
Thanks
VinayCould you please put some light on which part of the transaction MMAM is responsible in changing the Material type. I can understand that there may exist may checks in the Tx MMAM but I would like to know where is the material Type getting changed in the Tx MMAM. On going through the Tx MMAM I have across many forms and function modules but its difficult to track the form/Function Module responsible for changing the Material Type. Please help me in this.
Maybe you are looking for
-
Hello All, I am having a serious crashing problem in PrE9 that I can't resolve. I consider myself to be an intermediate level user and have used PrE9 for a couple of years now. I was creating a video when the app starting consistently crashing. I can
-
Is the IP Address embeded in the SapLogon Ticket?
Hi, We are in the middle of the development of a SSO solution and we have a question, does the IP address goes embedded into the SAP logon Ticket? Thanx a lot!
-
Find all texts in custom programs
my Client wants to tranlate all the Dutch text messages in English. He requested to find all the programs where the translation is required. Any suggestions on the approach. I tried going to SE91 and do where used list of all the custom message class
-
I cannot show my video files on microsoft office program with macair book 11 inc notebook while using projector
-
Creating Password galleries on a webpage
I am wondering if anyone has a link to a tutorial that will help me create a gallery on a webpage that requires a password to open the gallery. The link provided is a perfect example. The layout for the site isnt important. I kno they used flash for