Skip to Content
author's profile photo Former Member
Former Member

Dialogs in BDCs

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


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2006 at 09:24 AM

    Hi Andrew,

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


    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'


    that should solve your problem.

    Reply if you need any furthur information.

    • Reward if helpful****

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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.


  • author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2006 at 10:33 AM


    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.


    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member


      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.


Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.