cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to Stop at the BAdi Implementation BBP_CREATE_BE_RS_NEW

Former Member
0 Kudos

Hi All,

I am Implementing the BADi BBP_CREATE_BE_RS_NEW to create/make changes to the follow on document as the Reservation in the SRM system.

I am facing the following Problems in it:

1. Even after putting a Break-point in the Implementation of the BADi, the control does not stop there.

Why does this happen? The BADi is active and the respective custmozation also has been taken

care of.

2. There is an Importing and changing parameter of the BADi.

The Importing parameters has the Unloading point wihch needs to be copied to the Unloading point of Changing parameter and should be reflected in the the Reservation which gets created as the follow-on Document. Also the Goods movement Indicator allowed has to be tikcked on.

Now when I copy the Unloading pt from the Importing to the changing parameters and then use the MODIFY statement to modify the line of the Internal table of the Changing parameters,the Follow on Doc gets cretaed but the field value is not copied nor is the Goods movement Indicator turned on.

When I copy this value of Unloading pt and the Indicator and try to Append the Internal table of the Changing parameter the Shopping cart runs into an Error. the reason is not know to me.

3. I am not sure whether the Changing parameter, When the BADi Implementation gets called, would be copied automatically by the system or Do we need to create the Individual lines of the changing parameters?

Can anyone help?

You can Expect the Full reward poing if your solution works.

Regards,

Deepak.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

1.

You can put an endless loop in your BADI BBP_CREATE_BE_RQ_NEW ,as shown below and force the program to stop there. Now go to SM50 and switch to debug mode for the program and start debugging(take process that keeps hangs in your endless loop).

Data: l_flag.

do.

if l_flag eq 'X'.

exit.

endif.

enddo.

2. & 3.

Refer this related thread:

BR,

Disha.

Former Member
0 Kudos

Hi Disha,

Thanks for your inputs so far. There is one more doubt.

1. Is the BADi BBP_CREATE_BE_RS_NEW triggered for creating the reservation while creating the shopping cart application.

Our requirement is create the follow on doc as the Reservation while creating the shopping cart application which we are doing succeefully with the help of the other BAdi which would override the settings and rather then the PO, the reservation should be and is getting created. This BADi is BBP_EXTLOCALPO_BADI. Here we just make a flag to ' ' and it creates a Reservation and not the PO.

I am only suspicious aboout the BADi mentioned above for creating the reservation whether it is really getting triggered while the Shopping cart appln is run. Since the Run time analysis it does not show up this BAdi at all. Can you please confirm on this?

IF in case this is the case can you suggest some other BADi which would create the Reservation in the back end system while the Shopping cart is Run.

Thanks once again...!!!

Regards,

Deepak.

Former Member
0 Kudos

Hi,

Did you try put the endless loop in the BADI?Also Which SRM version are you working on?

This BADI is definately called when creatig the reservation in the Backend system.See whether you are writing your code in the correct method also within the BADI.

Please read the documentaion of this BADI:

Reservation in Backend System

Using the Business Add-In BBP_CREATE_BE_RS_NEW, you can change all the data that is transferred to the backend system for generation of a reservation. This includes header and item data.

All the shopping cart data is available as input parameters.

The following two methods are available depending on the BAPIs used to generate the backend reservation:

FILL_RS_INTERFACE1

when using BAPI BAPI_RESERVATION_CREATE1

FILL_RS_INTERFACE

when using BAPI BAPI_RESERVATION_CREATE

In the classic technical scenario, MM backend systems are involved in generating follow-on documents (purchase requisition [RQ], purchase order [PO], reservation [RS]) from shopping carts (SC) created in SRM.

As of SAP SRM 5.0, unlike in past releases, all SC data is available for transfer into the backend. New BAdIs have been developed to import this data and transfer it to backend BAPIs (backend systems from R/3 4.70: new BAPIs [BAPI_PO_CREATE1 and BAPI_RS_CREATE1]) when they are called, so that follow-on documents are supplied with and enriched by additional fields and information. Since item hierarchy information is being transferred, it is also possible to represent structured items in backend documents.

These changes does not have any obvious effect on Customizing activities - they only affect internal processing. You can - but do not have to - use the additional data and enhanced interfaces for generating follow-on documents.

Details:

The creation of backend documents is triggered in so-called drivers. These are determined as previously in system table BBP_FUNCTION_MAP from the business object of the follow-on document, from the backend system, and the Create method. The method that has been used up to now (CreateFromData) has been replaced by a new method called CreateFromData1.

Caution: Any modification you may have made might get lost when you upgrade. You should always use the BAdIs listed below if you want to make customer-specific changes.

You can use Business Add-In BBP_DRIVER_DETERMINE [ Determination of Driver Function Modules] to specify that a different driver should be called instead of the driver that is determined by default.

The new Create BAPIs (BAPI__CREATE1) are called in backend systems running on R/3 4.70 and higher; the older BAPIs BAPI_CREATE are still called for systems prior to R/3 4.70. (This also ensures continuity in the Intrastat functionality if you populate the relevant fields with the methods of BAdI BBPCREATE_BE_PO_NEW.)

The existing BAdIs for changing the parameters for generating documents in the backend system have been replaced by new BAdIs, but the default implementation still supports these old BAdIs. The same applies to the BAdIs for grouping documents (distributing SC items in backend documents).

Old BAdI: Replaced by: Methods:

BBP_CREATE_PO_BACK BBP_CREATE_BE_PO_NEW ( Purchase Order in Backend System) FILL_PO_INTERFACE (Change SC Data for BAPI_PO_CREATE)

FILL_PO_INTERFACE1 (Change SC Data for BAPI_PO_CREATE1)

BBP_CREATE_REQ_BACK BBP_CREATE_BE_RQ_NEW ( Purchase Req. in Backend System) FILL_RQ_INTERFACE (Change SC Data for BAPI_REQUISITION_CREATE)

BBP_CREATE_RES_BACK BBP_CREATE_BE_RS_NEW ( Reservation in Backend System) FILL_RS_INTERFACE (Change SC Data for BAPI_RESERVATION_CREATE)

FILL_RS_INTERFACE1 (Change SC Data for BAPI_RESERVATION_CREATE1)

BBP_SC_TRANSFER_BE, BBP_RESERVATION_GRP BBP_BS_GROUP_BE ( Grouping of Shopping Cart Items for Follow-On Documents) GROUP_PO_BACKEND (Grouping of Backend PO)

GROUP_RQ_BACKEND (Grouping of Backend RQ)

GROUP_RS_BACKEND (Grouping of Backend RS)

GET_NUMBER_OR_RANGE (Change Document Number or Number Range Interval)

BBP_TARGET_OBJECTS BBP_TARGET_OBJTYPE ( Determine Target Objects in Backend) DETERMINE_TARGET_OBJECT_TYPES (Determine Target Objects in Backend)

From a technical perspective, the old BAdIs are still supported by means of a standard query in the program code. If old BAdIs are recognized as being active (implemented), they are called automatically. In this case, the enhanced functional scope will not be available.

Another way of checking whether the BADI's(gen which are called in the backgorund) is creating a log in SLG1 within your BADI.This way if your log is wriiten in transaction SLG1,it means the BADI is being called in the background.All the BADI's for the follow on doc creation in the R/3 backend are being called in the backend once you CREATE the SC in SRM system.You can try this method also to verify if the BADI is being called or not.

BR,

Disha.

DO reward points for useful answers.

Former Member
0 Kudos

Hi Disha,

Thanks for all your inputs. It seems that you have done quite a good amount of R&D for answering this question. I am rellay extremenly pleased.

Ok now the situation is like this.

We use SRM ver 5.0. I tried putting an Endless loop in the BAdi and checked in SM50 but no process runs longer. In the BADi I also tried putting an Abend message but does not dump. This used to happen in case of the Previous BADi for converting the PO to the Resrvation just by overriding the settings.

This creates a doubt in my mind abt whther the BAdi is really getting called.

Secdon I also looked at the table BBP_FUNCTION_MAP table but was looking at the method CreateFromData so far. Neverthless I do not know which business object does the resrvation belong. Nor do I need to change the Driver FM since this BADi has to work.

Now the major isssue is if we try to convert the PO to REsv by overriding the settings should this BAdi be called.? IF yes then why none of the above mentioned remedies are working including the Endless loop.

I looked at the older SAP notes of 2003 and 2005 but they are already implemented in here in5.0.

There is a flag called as MOVEMENT_AUTO in RS1 and MOVEMENT in RS. I tried marking both the fields in the method FILL_RS_INTERFACE & FILL_RS_INTERFACE1 but still does not work out.

All the time I created a shopping cart I used check the RESB table for Goods movement and the Unloading point both are always blank.

Any clues why this is happening.

Although my problem is not solved yet I am still giving you some reward points.

Expecting the favourable reply from you.

By the way which part of India are u from?

Regards,

Deepak

NL

Former Member
0 Kudos

Hi Deepak,

Thanks for the appreciation.

With SRM 4.0,the endless loop definately works.But as I said,you can try to create a log and see whether the BADI is getting called.I have been using this workaround for all the backgorund BADI's and it works

In table BBP_FUNCTION_MAP,you can see all the driver FM's for reservation by giving the object type "BUS2093".The class used for reservation is CL_BBP_BS_ADAPTER_RS_CRT_470.

The FM "B470_RESERVATION_CREATE" is used to create the reservation in the R/3 backend system.

Refer the foll useful threads which discuss abt your reqts:

BR,

Disha.

Do reward points for useful answers.

imthiaz_ahmed
Active Contributor
0 Kudos

I think there is some kind misunderstanding here.

Deepak said:

I am only suspicious aboout the BADi mentioned above for creating the reservation whether it is really getting t

riggered while the Shopping cart appln is run

Disha said:

This BADI is definately called when creatig the reservation in the Backend system

Not while creating the SC

Simple: This BADI is called when the SC is approved and tries to create a backend document, and not during the SC creation.

Regards, IA

Former Member
0 Kudos

Hi Disha,

Based on the inputs received from you, I tried the all possible options Including putting the break points in the FM 'B470.... ' but some how nothing seems to be working out for us. We did the Run time analysis again but neither the old badi ... BACK nor the new badi ...NEW is getting called. Tried implementing the Old Baid also but still no result. We then Degugged the standard SAP code and tried to see if any other BADi is applicable and we found one which works for the Unloading point.

BUT the issue of the goods movement Indicator is still as it is. It is still blank in RESB. Although Both the old and the new BADis have the fields for setting the Goods movement Indicator but still does not work.

We then looked at the SAP note 903805 which has a mention of this Field Goods movement allowed but this note is already implemented in the SRM version 5.0 which we have.

Now we are not sure as to how to handle this Field which is MOVEMENT in RS_INTERFACE and AUTO_MOVEMENT in RS_INTERFACE1.

Can you please suggest what should be done next?

You can epxect the Reward points again if your solution works.

Regards,

Deepak.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Peter,

The reservation would be created only after the Shopping cart is ordered and approved.

Hence i am bit confused of keeping the shopping cart in ' Held ' Status..

If you could throw sme light on this .......it would be very greatful.....

Thanks in Advance,,,

Vidya

peter_novoth
Active Contributor
0 Kudos

Hi Vidya,

I guess it's going about your test system, where you would like to see how the BAdI works. In this case I guess it wouldn't be a big problem when the transfer isn't called in the normal way.

So from the technical perspective of the follow-on document creation the approval and the ordering are not so important (from business process they are essential for sure).

If there is no error in the SC, technically the transfer can be triggered, and the follow-on document will be created.

So create a SC with hold status, and for this, please start the BBP_PD_SC_TRANSFER.

Regards,

Peter

Former Member
0 Kudos

Hi Peter.........sure i'l try it out and get back to you.thanks a lot...:)

Former Member
0 Kudos

Hi Peter,

I tried as per your suggestion using function module BBP_PD_SC_TRANSFER .

The only Badi that is triggered in the process is BBP_CREATE_BE_RS_NE & method FILL_RS_INTERFACE .

When it goes to the debugging mode it uses the FM BAPI_RESERVATION_CREATE .

But , Our requirement is to overwrite the movement type of the reservation, other than the default one maintained in the user attributes( default maintained is 201 ).

This logic is written in the Badi BBP_CREATE_RES_BACK , but this is not triggered at all.........

(For first hand information : we are in a Upgrade process from SRM 3.0 to SRM 5.0..)

PLease let me know your inputs....

Thanks in Advance..........

Vidya

Former Member
0 Kudos

Hi Peter.............Any inputs ???

Former Member
0 Kudos

Hi Peter.....

Thanks for helping to debug the badi,...how can i award points to you..??

peter_novoth
Active Contributor
0 Kudos

Hi Vidya,

by setting the question to answered I guess you will have the choiche to provide points

Regards,

Peter

peter_novoth
Active Contributor
0 Kudos

Hi Deepak,

the breakpoint doesn't stop the coding, as the transfer of the SC happens in the background (due to WFL issues).

However you have the possibility to start the SC transfer forderground process, where you can debug, and see your breakpoints. For this there are several methods, but the easiest way:

- Create a SC and set it on the status 'hold' (make sure that there are no errors in it)

- Set the breakpoint in the BAdI implementation

- Execute the function module BBP_PD_SC_TRANSFER with the GUID of the SC (you can get the GUID from the transaction BBP_PD)

This was the WFL won't be triggered and therefore you can debug in forderground.

Regards,

Peter

Former Member
0 Kudos

Hi Deepak,

Has your problem got solved!!!

Even I am facing the same problem...

We are using BBP_CREATE_RES_BACK to create reservations in backend..

but the badi never seems to get triggered....I tried with an external break-point,,then with an endless loop in the badi and debugging through SM50...but nothing seems to work........

Could you please share the solution for this problem.........!!!!!!!!

Thanks in advance........

Vidya