Skip to Content
0

"Enter Plant" error using CALL TRANSACTION with BDC data for transaction ME11.

Feb 20 at 10:46 AM

90

avatar image
Former Member

Hi,

I'm really at the end of my teather with this issue.

I'm getting an'Enter plant' message 06 381 when using BDC via a CALL TRANSACTION against transaction ME11, used to create a new PIR. We never enter a Plant, ONLY providing Vendor, material and purchase org. So the message saying 'Enter Plant' is a bit of a mystery. If I manually enter ME11 and put the same data as used in my recording I can successfully create a PIR as well.

Initially I was using the MODE (P) and UPDATE (S) options for CALL TRANSACTION, but I found that if I changed the MODE to 'A' and actually stepped through the recording on screen then it always worked just fine, but when running in background then did not, even though it's the same recording.

My next step was to use the OPTIONS parameter ( Type ctu_params) to replace the MODE and UPDATE options. Setting 'NOBINPT' to 'X' should force the background process to behave as though running in foreground I believe, but I'm still getting the 'Enter plant' message, regardless of the OPTIONS paramter.

  gv_options-DISMODE  = 'P'.
  gv_options-UPDMODE  = 'S'.
  gv_options-CATTMODE = ' '.
  gv_options-DEFSIZE  = ' '.
  gv_options-RACOMMIT = ' '.
  gv_options-NOBINPT  = 'X'.
  gv_options-NOBIEND  = ' '.

I have also tried setting the 'DEFSIZE' to 'X' and also changed the DISMODE to 'E', but nothing makes a difference. As well as that I have also set NOBINPT to SPACE as well, as help on this option is a little confusing. Still no joy though.

My CALL line of code looks like this:

CALL TRANSACTION 'ME11'
     USING lt_bdcdata 
     OPTIONS FROM gv_options 
     MESSAGES INTO lt_messtab.

Any suggestions would be more than welcome.

pir
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Jürgen L
Feb 20 at 12:17 PM
0

I think it simply is based on the values you have in lt_bdcdata

What value do you submit in the plant field?

The screen is hardcoded and it is not even easy to make that field mandatory as you can read in OSS note 1860711 - How to make plant field mandatory in transaction ME11

Show 7 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Jurgen, I don't provide anything for Plant as it's not needed or required. We want a global PIR and not plant specific.

However, the message coming back say 'Enter PLant' message ID 06 Message no. 381

I have just created an SM35 session for the exact same data and this just worked, even being run in background. So I guess it has something to do with the CALL transaction 'ME11' line that I'm using. Although all values look complete.

0

I guess you have to contact SAP if you don't show anything to us.

What is actually "I don't provide anything for Plant"

is it blank in the field?

is it a '/' in the field?

Is the field not included?

0
Former Member

Jurgen, I did say in my original posting "We never enter a Plant", but to answer your question correctly, this is the complete recording.

*         selection screen
          PERFORM bdc_dynpro        USING 'SAPMM06I'        '0100'.
          PERFORM bdc_field         USING 'BDC_CURSOR'      'EINA-LIFNR'.
          PERFORM bdc_field         USING 'BDC_OKCODE'      '/00'.
          PERFORM bdc_field         USING 'BDC_OKCODE'      '/00'.
          PERFORM bdc_field         USING 'BDC_OKCODE'      '/00'.
          PERFORM bdc_field         USING 'EINA-LIFNR'      gs_pir-zzlifnr.
          PERFORM bdc_field         USING 'EINA-MATNR'      gs_pir-matnr.
          PERFORM bdc_field         USING 'EINE-EKORG'      gc_purch_org.                "Defaulted as per spec
          PERFORM bdc_field         USING 'EINE-WERKS'      ''.                    "Left empty as per spec
          PERFORM bdc_field         USING 'RM06I-NORMB'     'X'.                   "Category is not provided, so defaulting to this option
*         General Data Screen
          PERFORM bdc_dynpro        USING 'SAPMM06I'        '0101'.
          PERFORM bdc_field         USING 'BDC_CURSOR'      'EINA-RELIF'.
          PERFORM bdc_field         USING 'BDC_OKCODE'      '=EINE'.
*         PERFORM bdc_field         USING 'EINA-MAHN1'      'record-mahn1'.
*         PERFORM bdc_field         USING 'EINA-MAHN2'      'record-mahn2'.
*         PERFORM bdc_field         USING 'EINA-MAHN3'      'record-mahn3'.
          PERFORM bdc_field         USING 'EINA-IDNLF'      gs_pir-idnlf.
          PERFORM bdc_field         USING 'EINA-LTSNR'      ''.
          PERFORM bdc_field         USING 'EINA-RELIF'      'X'.
*         Purchase Org 1 screen
          PERFORM bdc_dynpro        USING 'SAPMM06I'        '0102'.
          PERFORM bdc_field         USING 'BDC_CURSOR'      'EINE-EKKOL'.
          PERFORM bdc_field         USING 'BDC_OKCODE'      '=KO'.
          PERFORM bdc_field         USING 'EINE-APLFZ'      lv_aplfz.
          PERFORM bdc_field         USING 'EINE-EKGRP'      gs_pir-ekgrp.
          PERFORM bdc_field         USING 'EINE-NETPR'      lv_netpr.
          PERFORM bdc_field         USING 'EINE-WAERS'      gs_pir-waers.
          PERFORM bdc_field         USING 'EINE-PEINH'      lv_peinh.
          PERFORM bdc_field         USING 'EINE-MWSKZ'      ''.                    "Not provided so set a empty

*         Overview of Condition types
          PERFORM bdc_dynpro        USING 'SAPLMEKO'        '0501'.
          PERFORM bdc_field         USING 'BDC_CURSOR'      'T685-KSCHL(01)'.
          PERFORM bdc_field         USING 'BDC_OKCODE'      '=PICK'
*         PB00
          PERFORM bdc_dynpro        USING 'SAPMV13A'        '0201'.
          PERFORM bdc_field         USING 'BDC_CURSOR'      'KONP-KBETR(01)'.
          PERFORM bdc_field         USING 'BDC_OKCODE'      '=SICH'.
          PERFORM bdc_field         USING 'BDC_CURSOR'      'RV13A-DATAB'.  
          PERFORM bdc_field         USING 'RV13A-DATAB'     lv_date.
          PERFORM bdc_field         USING 'KONP-KBETR(01)'  lv_netpr.           "Rate (condition amount or percentage) where no scale exists
          PERFORM bdc_field         USING 'KONP-KONWA(01)'  gs_pir-waers.       "Rate unit (currency or percentage)
          PERFORM bdc_field         USING 'KONP-KPEIN(01)'  lv_peinh.           "Condition pricing unit

.

So, to recap. If I run this program in foreground it always works. If it created a PIR then the returned message type is 'S', message ID is '06' and message number is 331 (Successfully created PIR). If it already exists as a PIR then the message type is 'E' and the message ID/No. is '06' and '312'.

If run in background via CALL TRANSACTION 'ME11' (Mode value 'N', or 'P', and UPDATE value of 'S') Then it neither reports that it's successfully created a PIR or identifies that a PIR already exists. In both cases it returns a message status of 'S', a message ID of '06' and message No. of '381', which is 'Enter Plant'. However it may well have been successful in creating the PIR or the PIR may already exist. But we can't tell that from then returned message, other than perhaps an 'S' message type.

0

why do you have BDC_OKCODE 3 times in your selection screen?

0

Usually batch inputs have a NODATA field where you specify a default in case you do not explicitly provide a value.

This NODATA sign is usually a forward slash

Of course when running a batch input in foreground SAP can know that no entry means no entry but in background session you should have the NODATA sign to introduce your will.

https://help.sap.com/saphelp_nw70/helpdata/EN/fa/097063543b11d1898e0000e8322d00/frameset.htm

0
Former Member

Jurgen,

Yes, I would agree with you for LSMW's etc. But bear in mind that I re-directed the BDC data to SM35 and then processed it successfully in background, without any modifications to the BDC itself. Unless SM35 puts a nodata character in where ever the value supplied is null.

I'll try anything to get this working, to be honest. So will will try setting a constant for noData to '/' and using that accordingly.

0
Former Member

No joy with the Nodata value.

I'm now looking at FM's and/or BAPI's to create a PIR. I've given up on creating PIR's via the CALL TRANSACTION in background. They work fine in foreground though.

Thanks for your help though Jurgen. ;)

0
Sandra Rossi Feb 22 at 09:02 PM
0

As you have tested all basic possibilities, you should better run a SAT trace for the batch input mode and another one for the real mode, and compare automatically the 2 traces with the compare button. When you know why there is a difference, then you can make a decision.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thanks Sandra, I have resolved the issue now, but I keep that in mind for the next similar related problem.

Much appreciated.

1