BADI BOM_UPDATE
Hi all
where I can find samples about BADI BOM_UPDATE?
txs
Stefano
hi,
DATA: l_matkl type mara-matkl.
DATA: stpob TYPE stpob.
DATA: FIELD_NAME(30) VALUE '(SAPLCSBT)O1-STPOB[]'.
FIELD-SYMBOLS: <TABLE> TYPE TABLE.
ASSIGN (FIELD_NAME) TO <TABLE>.
LOOP AT <TABLE> INTO STPOB.
clear l_matkl
clear stpob-sortf.
select single matkl
from MARA
into l_matkl
where matnr = stpob-idnrk.
if sy-subrc eq 0.
concatenate l_matkl(3) '.' stpob-posnr(3) into sortf.
modify <table> from stpob.
*else.
*modify <table> from stpob.
endif.
ENDLOOP.
COMMIT WORK and WAIT.
Regards
Similar Messages
-
BADi BOM_UPDATE cannot trigger mail as FM giving dump
Hi Experts,
I have a requirement to send mail at BOM change. I am using BADI BOM_UPDATE~CHANGE_BEFORE_UPDATE method for that.
Here I am using FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send mail. But when i am using COMMIT = 'X' in the FM it is giving dump COMMIT_IN_PERFORM_ON_COMMIT. But without using commit the mail is not getting fired. So can anyone give me a solution? Please suggest me.
Regards,
SURYAHi Keshav,
Thanks for your reply.
Actually I have used method Change_at_save of that badi and there the FM SO_NEW_DOCUMENT_ATT_SEND_API1 is working fine with commit = 'X' but I cannot get the item data which has been deleted from from BOM item. The problem which i am facing is that the item which has been deleted is coming with the other data in DELTA_STPOB and DELTA_STASB. So i cant distinguish between them. So i have used change_before_update which is showing the deleted item with an indicator 'D'. So i am using change_before_update method of the mentioned badi. Can you suggest anything more please.
Regards,
SURYA -
Hi, i need to do the following operation:
When somebody make a change throw C202 transaction i need to force the status (PLKOD-STATU) to one specific status and block the edition for some users (controled by a role). So i need two exits or badis....one to enforce the status and another to block the edition for somo users (using a authority check)
I try to use the badi BOM_UPDATE but all the parameters are only input; and i need to change the STATU.
¿Some Idea? Thks in advance,.Hello,
For the authorization check, this user-exit should work: EXIT_SAPLCZDI_004.
Look also the BADI definition EWB_SELECTION. Seems to be useful for you.
Regards,
Flavio. -
How to trigger a background job from BADI method.
hi friends,
i need to trigger a background job from the badi method CHANGE_AT_SAVE for the BADI BOM_UPDATE.
for this i think i need to create an event which i should give with parameters during job creation.
can you pls help me solve this issue.
thank u all.Hi Saravanan,
Here is an example of what you have to do.
Regards,
Eric
Reward any helpful sugestion.
*& Form generar_job
FORM generar_job .
Generar Variante
PERFORM generar_variante.
w_fecha = sy-datum + 3.
CALL FUNCTION 'DATE_COMPUTE_DAY'
EXPORTING
date = w_fecha
IMPORTING
day = w_weekday.
Si la fecha cae en sabado o domingo se debe continuar el lunes.
CASE w_weekday.
when '1'.
ADD 2 TO w_fecha.
WHEN '6'.
ADD 2 TO w_fecha.
WHEN '7'.
ADD 1 TO w_fecha.
ENDCASE.
w_jobname = 'ZQM_CIERRE_LOTE_INSPECCION'.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobgroup = 'QUEUE'
jobname = w_jobname
IMPORTING
jobcount = w_jobcount
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc EQ 0.
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
authcknam = sy-uname
jobcount = w_jobcount
jobname = w_jobname
report = 'ZQM_CIERRE_LOTE_INSPECCION'
variant = w_var
IMPORTING
step_number = w_stepnum
EXCEPTIONS
bad_priparams = 1
bad_xpgflags = 2
invalid_jobdata = 3
jobname_missing = 4
job_notex = 5
job_submit_failed = 6
lock_failed = 7
program_missing = 8
prog_abap_and_extpg_set = 9
OTHERS = 10.
IF sy-subrc EQ 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = w_jobcount
jobname = w_jobname
sdlstrtdt = w_fecha
sdlstrttm = w_hora
IMPORTING
job_was_released = w_rel
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
IF sy-subrc EQ 0.
IF w_rel EQ 'X'.
WRITE:/ w_jobname, 'FUE LIBERADO. VER SM37.'.
Guardamos los destinatarios
PERFORM destinatarios_job.
Guardamos la información a utilizar al ejecutar el job
PERFORM guardar_datos_job.
ELSE.
WRITE:/ w_jobname, 'NO FUE LIBERADO'.
ENDIF.
ELSE.
WRITE:/ w_jobname, 'NO FUE CERRADO'.
ENDIF.
ELSE.
WRITE:/ w_jobname, 'NO FUE ENVIADO'.
ENDIF.
ELSE.
WRITE:/ w_jobname, 'NO FUE CREADO'.
ENDIF.
ENDFORM. " generar_job -
Hi ,
My requirement is that while saving a BOM , checking the BOM usage and category I need to set the Base order quantity value to 1. I checked the user exit,
PCSD0007 and found that it had no exporting parameter to change the base quantity. I also checked the BADI BOM_UPDATE and method Change_at_save but it also does not have any changing parameter to change the quantity. Please let me know how this can be accomplished.
Regards,
Prabaharan.GProblem solved using available exit
-
Hi All,
My requirement is to automatic creation of IDoc for any creation/changes of CS01/CS02/C201 after save
I found the badi BOM_UPDATE .from badi I have to call the Custom FM to create IDocs.
I have changed BOM item details and tried to look at the changed item details ( BADI: bom_update In debugging mode ) .But I have noticed both old and new changes item details in delta_stpob variable . so how to find out the updated records or new ?
Is there any specifc badi or user exit to find new changed details of BOM or after updation ?
Please help me .
Thanks,
VinayHi Santosh,
Thanks for response.
Change pointers will not work for bom alternatives and I can't use it because we have to run the program RBDMIDOC ( My requirement is automatic creation ).
Is there any BADI for BOM after saving the changes ?
Thanks,
Vinay. -
Unable to get key field value in Method
Dear All,
I am Trying to implement Notification workflow on BOM Change.
I am doing it via BADI : BOM_UPDATE
* " Declare Variable for Object Key
DATA : l_objkey TYPE sweinstcou-objkey,
wa_stzu TYPE stzu.
LOOP AT delta_stzub INTO wa_stzu.
ENDLOOP.
* " Pass Object Key Variable to Business Object
CONCATENATE wa_stzu-stlty wa_stzu-stlnr INTO l_objkey.
* " Function to call Business Event
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
objtype = 'ZBO_BOM_NF'
objkey = l_objkey
event = 'TR_BOMNF'
debug_flag = 'X'.
IF sy-subrc = 0.
WRITE : /5 'Event is triggered wf started'.
ELSE.
WRITE : /5 'No Event is triggered Check WF'.
ENDIF.
When i use this value in my method no value is passed
select single * from mast where stlnr = object-key-stlnr.
variable object-key-stlnr doesn't bring required val.
Thanks all,
Regards,
Gaurav Sood
Can you please tell what went wromg hereHi Gautam,
How r u,
Requirement :
I want to initiate a WF on BOM Change.
Steps
1. called FM in BADI to trigger WF when BOM is changed. ( Working Fine ).
2. WF is initiated and reciever has it his SAP inbox ( Working Fine ).
3. User should be able to Display BOM from WF using CS03
as per Code
select single * from mast where stlnr = object-key-stlnr
SET PARAMETER ID 'MAT' FIELD mast-matnr.
SET PARAMETER ID 'WRK' FIELD mast-werks.
SET PARAMETER ID 'CSV' FIELD mast-stlan.
CALL TRANSACTION 'CS03' AND SKIP FIRST SCREEN.
The Problem here is that value object-key-stlnr is blank here.
Rgds,
Gaurav Sood
1 100000003 ZBO_BOM_NF -
Hello Experts,
I have need to change BOM Status in CS02 to be inactive when we save it .
The steps I do are :--
1. Goto CS02.enter material , plant BOM Usage
2. Click on header level ,and now whatever be the BOM status , but when we go to save it , the BOM status should be 2.
The function exits I used are :--
1.EXIT_SAPLCSBT_001
2. EXIT_SAPLCEB1_003
But , both are not triggering when I save my BOM .
So , I need your valuable guidance ,to solve this issue.
Regards,
JeetHi,
Please try to implement method 'CHANGE_AT_SAVE' in BADI 'BOM_UPDATE' .
Hope it will work.
Thanks,
Leo -
When I change or create BOM I want to start my program before data save.
I've already looked through all possible enhancments for cs01 cs02 but can't find how to catch the event "save". Header changes, item changes I can handle, but not Save?
Any advice?
Thank you.You can use BADI BOM_UPDATE and method CHANGE_AT_SAVE or CHANGE_IN_UPDATE
-
CS02 - trigger a mail after saving
Dear Sapians,
I come through a requirement in which , i have to trigger a mail to authorized user with detail of changes done in CS02 by unauthorized user.
I got a BADI 'BOM_UPDATE' 'CHANGE_AT_SAVE'.
And as per my understanding change detail are in table CDHDR and CDPOS.
And in above table data is loaded after CS02 is saved.
So, no detail of recent changes done is reflected in CDHDR and CDPOS .
So, I am looking for some USER-EXITS or BADI , which help me out in this scenario.
Scenario is :--
a).
When changes are done in CS02 by some UNAUTHORIZED USER, changes has to be verified by AUTHORIZED USER, so change detail has to be send to AUTHORIZED USER.
Awaiting for your reply
Thanks,
JeetDear Vivek,
You are very correct .
Sorry for not discussing the whole scenario.
Actually , If some unauthorized user gas done some changes in CS02 than BOM Status is to be '2',
so mail is needed to ask authorized user permission to set BOM status '1'.
But in the same time , authorized wanna know what changes are done. and changes are recorded in cdhdr and cdpos tables which is updated after after bom is saved not in between.
That why mail is needed. -
User exit to check the component in BOM
Hi
I am performing BOM change in SAP using change number.
and this change number is maintained in the ztable with parent / child and required change details.
When perform BOM Change using CS02, i need to compare this table and trigger error message.
I mean if somebody is uing change number against a wrong material other than the material mentioned in the ztable.
I want to trigger the error message
can u pls tell me the appropriate user exit to use
Regards
DMHi,
I did a implementation on BADI : BOM_UPDATE.
Here change number is available in DELTA_STPOB. But the problem is this badi is only triggered when save is pressed, so when a trigger an error message entire screen gets freezed. -
We have one client with 3 different plants in it.
In customizing a default bom status was defined (fully released) which currently applies for all plants.
this now raises a problem in one of the plants due to different products. So this plant requires that the default status should be "not released".
My question;
Is it possible to define the default bom status "plant dependent" ? i.e. to have a different default start status for bom for different plants in the same client?
2nd question: Is there a way to mass-change the bom status for a material-bom with the entire sub-hirarchy? CS20 transaction somehow does not seem to work (or I don't find the appropriate settings).
Thanks a lot in advance.Hi,
For part - 1 of your query check with your developer on the BADi - BOM_UPDATE, which of the method best suits your need. the parameter would be: DELTA_STKOB-STLST (i.e. BOM Status). Here you can change the value depending on your need.
For part - 2 of your query, you can work with CEWB. For the current working area specify SAP_BOM. Specify the material, plant & usage details. Then press CTRL + F8 or follow menu path Bills of material -> BOM header. Click on pencil, select the column, then the rows, then follow menu path: Extras - Mass change.
If you're new to CEWB, would suggest to test in sandbox first.
Regards,
Vivek -
Hi,
In CS01, CS02 transactions, i need to update de field STPO-DSPST. I tried to use BADI BOM_UPDATE, CEWB_BOM_UPDATE, exit PCSD0xxx and BTE CACS0000 but in all of them i didn´t get to modify the valeu of this field.
Can anyone help me?
Thanks!!!!!
RicardoHi ,
Please read the below help for Explosion type .
If the Explosion type is Phantom assembly off
You use the Phantom assembly off indicator, to determine how an assembly with the Phantom assembly special procurement key is exploded.
If the header material of an assembly has the special procurement key for a phantom assembly in its material master record, the standard SAP System:
Transfers dependent requirements for the superior assembly directly to the components of the phantom assembly
Generates planned orders or purchase requisitions for the components of the phantom assembly
If you set this indicator, dependent requirements are also generated for materials that have the Phantom assembly indicator.
So when you are using the badi or function check your material master record which a link to explosion type.
Please reward if useful. -
Is there a user exit to restrict BOM change and display using material type?
Hi Gurus,
There’s a need to limit access to BOMs on a per material type however the client does not want to use the functionality of "BOM Authorization Group" in BOM header details.
Do we have a user exit that can satisfy the said requirement?
Thanks,
MaeHi
Restriction to Changes of BOM will have better control using authorization object .Go to PFCG with your basis guy and try to explore the objects
You can use C_AENR_BGR object to restrict.
Otherwise , try apply BADI BOM_UPDATE
Regards
JH -
Hi All,
I have a requirement in which i have to add alternate material to the BOM, I am using the transaction MRTRS_START for transformation of General recipe to Master recipe.
I have implemented the BADI BOM_UPDATE and used the method CHANGE_BEFORE_UPDATE to add my code to add alternate material to the DELTA_STPOB table.
Problem is,it is reflecting in C202/C203 but change number is not updated for the same and operation number is also missing for the added material.
Then i came across a class CL_RMXM_ROM_MR_MAT_ASSIGN and several other similar classes. I am not able to figure out how to proceed?
Thanks in advance.
Alok PatelIf you want it to be last for sure, why don't give it a number like 999? Or 777, so you will be able to add more later?
Maybe you are looking for
-
I am fairly new to editing so this may seem like a basic question. I am working on a project where there were 2 cameras. I put down the footage from the first camera into the time line. I am trying to overlay footage from the second camera on v2 so i
-
Adding semicolon at the end of text file in ssis
Hi, I have created a flat file through ssis. My input is excel file. I have 21 columns in excel so when i created flat file with row deliminator as CR LF and column del as ; i got 20 semicolons total for 21 coloums which is guinine . but i need 21 ;
-
ORA-31011 : Weird case of parsing/validation failure...
Hello all, It seems that when trying to insert into an XMLTYPE schema-bound column I am hitting a validation error that I cannot replicate with either XMLSpy os Stylus Studio. Here follow the schemas that are used, and the offending XML : envelope-co
-
I am receiving the following error message when I try to click on the Member Selection icon: 'Selected member list cannot be empty' Can someone please tell me what's causing this error, and how I can fix it? Thanks!
-
Unwanted Extra White Fram At End Of Movie
hello if i take a quicktime movie and do export for web, all the versions which are created have an extra white frame at the end of the movie. why? kind regards