Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Dialogs in BDCs

Former Member
0 Kudos

Hi everyone

I have a program that generates a BDC session that creates sales orders. We now have a requirement to change this so that as part of the BDC a line item rejection reason can be set. I have doen this using the following:


      PERFORM bdc_input USING:
        c_x 'SAPMV45A' '0250',
        ' ' 'BDC_CURSOR' 'RV45A-S_ABGRU',
        ' ' 'BDC_OKCODE' '=SUEB',
        ' ' 'RV45A-S_ABGRU'   t_grant-late_claim_block.

However, when running the resulting batch job it fails immediately after this bit has run.

When I enter a sales order manually, at the point that I have added the rejection reason I get a pop-up dialog saying that the rejection reason is within the contract start and end dates of the item, in order to proceed I have to click OK.

Presumably it is this that is causing the batch job to fail as it is not 'expecting' the dialog to appear.

Does anybody know how to handle these sorts of situations? I have tried recording a session but (as I later discovered in the Help) dialog boxes are nto recorded.

Thanks in advance

Andy

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Andrew,

Click on the SAVE in the dialog box and simultaneously press f1. you get a screen like this

(Example)

Program : SAPLSPO2

Function : OPT1

use it in your BDC as follows

PERFORM wa_bdc_dynpro USING 'SAPLSPO2' '0101'.

PERFORM wa_bdc_field USING 'BDC_OKCODE'

'OPT1'.

that should solve your problem.

Reply if you need any furthur information.

      • Reward if helpful****

11 REPLIES 11

Former Member
0 Kudos

Hi Andrew,

Click on the SAVE in the dialog box and simultaneously press f1. you get a screen like this

(Example)

Program : SAPLSPO2

Function : OPT1

use it in your BDC as follows

PERFORM wa_bdc_dynpro USING 'SAPLSPO2' '0101'.

PERFORM wa_bdc_field USING 'BDC_OKCODE'

'OPT1'.

that should solve your problem.

Reply if you need any furthur information.

      • Reward if helpful****

0 Kudos

Thanks Manish

I have tried this and it doesn't seem to have resolved the problem - I will investigate further, however, how do you know which screen number to use? The tech. info. box does not display this so I used '0101' as in your example in case it is a default.

Kind regards

Andy

0 Kudos

HI Andrew,

If you click F1 on the command prompt (Dialog Box) you will get the Screen number. You cna use that screen number and this should solve your problem.

Best Regards,

Manish

Message was edited by: Manish Patil

0 Kudos

Hi Manish

I don't know how to find the screen number - if there is one. I have tried F1 when the screen appears and it gives me a program name and a 'field' name but not a screen number. I have debugged the SAP code from the point that I change the rejection reason and the popup seems to be the result of a standard message command. If this type of popup has a screen number how do I go about finding it?

Thanks for your help so far!

Andy

0 Kudos

Andy!

Got some info for you. Rite discussing over your topic, one of the abaper here said that in background mode, no message related pop_up will appear. To be more elaborative, if the pop_up appearing is due to a message, then it will not appear in background mode. I am not pretty mucg sure, whether this is correct. So I will suggest you to give a try to this fact and run your trnx once in the background. If no pop_up appears, your problem solved. I repeat pop_up appears in foreground due to message but does not appear in background, as told to me.

Hope it works

Shane

0 Kudos

Hi Shane

As you posted this I was trying the same after speaking to a colleague who was back in the office today! Unfortuantely, I am still getting the same problem, however, I am starting to agree with the general consensus that these messages do not cause the problem. I think it is more to do with the logic of the session I am creating. The problem is when I call the Fast Edit screen for Rejection Reason from Sales Order creation. I have modified this from existing code that calls the Billing Block Fast Edit screen. If I place my code immediately after the existing code I get the error straight away but if I place it before then it continues happily until the last item has been entered, at which point I get the same error.

Any further help you can offer would be greatly appreicated though!

Andy

0 Kudos

Andy

You have done a serious mistake. How you can modify the code of Billing Block Fast Edit screen for Fast Edit screen for Rejection Reason. Do you understand what do I mean to say. See those two events have got different sequence, may be differenet screen sequence as well. I will suggest you to put SHDB trnx once again and record the respective step, for Fast Edit screen for Rejection Reason from SALES screen. Do not use the same code that you used for Billing Block Fast Edit screen. If I interpreted your problem correctly, then this is the solution. Hope it makes sense and works for you.

Shane

0 Kudos

Hi Shane

I think you are probably correct - the Rejection Reason Fast Edit goes to a different screen to the Billing block Fast Edit on completion. I worked round this by assigning the rejection reason directly to the line item in the end. However, this turns out only to be part of the problem. I have since found out that the BDC also fails when a sales order has a rejection reason on a certain item (posnr = 20) and a particular material (NVQ) also appears on the claim. I think this is because the material number is linked (via UEPOS) to the item at posnr = 20. If this item has a rejection reason then the the NVQ line automatically picks up this rejection reason. The error then occurs because certain fields (which the BDC tries to update later) are set to read only.

I think this is probably specific to our system so will speak to some people here about it.

Thanks again (Manish as well) for all your help.

Andy

Former Member
0 Kudos

andrew

i faced the same problem. rite now you have to find out whether the pop-up appearing is a dialog screen or list processing screen. if it's a dialog screen, yes ofcourse, in trnx SHDB, respective ok_code can be captured. but if it's list processing screen, then you have to find the co-ordinate. to be more elaborative run SHDB trnx and perform operation till end including pop_up, irrespctive of whatever it is. do i make any sense.

shane

0 Kudos

Hi Shane

I've debugged the code and it the dialog in question is caused by the line 'message i547'. I've tried recording a batch job using SHDB but it didn't seem to record this. Do you have any ideas on how I proceed from here?

Thanks

Andy

0 Kudos

andy

as off now i don't see any means to avoid this pop_up through bdc. only one way which can solve your problem is using bapi 'BAPI_SALESORDER_CREATEFROMDAT1'. hope u do not have to struggle a lot while changing code from bdc to bapi.

shane