2015 Jan 16 12:31 PM
Hi Friends
Am facing two issues with my program ,
1) Two BAPIs as per suggestion by client only ,am using in program first BAPI is ( BAPI_MATERIAL_SAVEDATA ) is uploading table MARD but for the field PSTAT ( Maintenance status ) Its uploading only one letter
example if value is DE then Bapi is uploading only 'D
2) second BAPI for create BATCH ( BAPI_BATCH_CREATE ) is not uploading data in table MCHB its giving below error
'No Batches are possible for material XXXXXXX in plant XXXX ' am not sure if its data issue or bapi is now working
If any one of you have any idea then please let me know
Thanks
Meeta
'
2015 Jan 16 12:49 PM
Hi,
1 -> for me this field indicates where you manage your material : MARA / MARC / MARD / MBEW ... maybe it removes your D because you didn't insert the values in the corresponding table
2 -> The batch flag is not set for your material / plant : MARC-XCHAR
regards
Fred
2015 Jan 16 12:58 PM
Hi Fred Thanks for your quick reply ,
1) If you see the attached code am not inserting that value inside bapi only its behaving like this
not sure why ?
2) The batch flag is not set for your material / plant , so what is the solution I should do for this
sorry am technical consultant ...so can you guide me if its data error if yes then how I can rectify it
Thanks
Meeta
2015 Jan 16 1:15 PM
Hi
Also I checked for that test material batch flag is set it is MACH-XCHAR = 'X' in this table
regards
Meeta
2015 Jan 16 1:37 PM
Regards,
Raymond
2015 Jan 16 1:54 PM
Hi Raymond Thanks for your inputs
1) I not find PSTAT in HEADDATA structure of bapi , can you please elaborate in detail how I can pass this field data .
2) Sorry It was my typo mistake I checked in MARC-XCHAR only the flag is X it is set for that material .
Regards
Meeta
2015 Jan 16 2:22 PM
2015 Jan 16 1:55 PM
your attached code does not at all do any BAPI call, it is just a batch input for storage location data.
And it does not have the field PSTAT.
The indicator E stands for purchasing view.
It is not at all possible to have a purchasing view at storage location level, hence MARD-PSTAT can never have a DE, it could only be a DL , D for MRP data at storage location level and L to storage location data.
2015 Jan 16 2:19 PM
Hi Jurgen thanks for sharing your input here ,
Earlier BDCs were getting used which got replaced with BAPIs as per suggestion of client
you can see all BDC code commented and BAPIs code is there in change number 07
CH07
I saw when BDC was used to update these Tcodes then DL was getting update but from Bapi only
D is getting updated you can see in below snap shot
2015 Jan 16 2:45 PM
Sorry, seems I did something wrong with ctrl+F
But still your call is just this, which means only storage location data.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = bapimathead
storagelocationdata = bapi_mard
storagelocationdatax = bapi_mardx
IMPORTING
return = it_return
TABLES
materialdescription = it_bapi.
and bapimathead has nothing more than just 2 fields:
bapimathead-material = w_matnr.
bapimathead-mrp_view = c_yes.
What else than L in MARD_PSTAT can you expect from this code?
You have not a single field that corresponds to planning data at storage location level to get a D in PSTAT.
All BAPI_TRANSACTION_COMMIT statements are commented too.
2015 Jan 16 6:07 PM
Hi Jurgen ,
1) Actually all data uploading in MARD Table from this BAPI BAPI_MATERIAL_SAVEDATA'
even PSTAT field also updating ,
only issue is from BDC its update as DL but with BAPI its updating only 'D'
eg :
in BDC code PSTAT = DL
in BAPI code PSTAT = D
what can we do for this at BAPI side ?
2 ) other issue is second bapi BAPI_BATCH_CREATE giving error ' 'No Batches are possible for material XXXXXXX in plant XXXX ' . and no data updating in table MCHB .
Regards
Meeta
2015 Jan 16 10:46 PM
The MRP4 screen of a material master is "multi-functional". you can access it by just having the plant number and you will see only the plant and client specific fields (from MARA and MARC table).
But if you add the storage location then you get as well the MRP4 screen specific fields at storage location level (from table MARD)
If you did not create this MRP view with storage location specific data, then you cannot have the D in the PSTAT field of table MARD.
Just try to go to MRP4 screen with MM03 and don't forget to enter the storage location, being in MRP 4 view look at the status message.
If you had not maintained location specific data in MRP4 screen while creating the material, then you should see a message telling you that no data exist.
The main field needed would be MARD-DISKZ the SLoc MRP indicator
I haven't seen this your BAPI.
The error with the second BAPI is just what was already said, you can read it yourself in the long text of the message, just execute SE91 enter message class M3 and message number 201. click display and in the next screen select the message and click long text.
You try to create a batch for a material that is not batch managed.
just try to create a batch for this material using the online transaction MSC1N, you should get the same message.
2015 Jan 17 4:53 PM
Hi Jurgen
Thanks for your inputs
c_yes = 'X' .
Actually I added some more parameters in headdata of bapi
bapimathead-basic_view = c_yes.
bapimathead-sales_view = c_yes.
bapimathead-purchase_view = c_yes.
bapimathead-forecast_view = c_yes.
bapimathead-work_sched_view = c_yes.
bapimathead-storage_view = c_yes.
bapimathead-account_view = c_yes.
bapimathead-mrp_view = c_yes.
bapimathead-cost_view = c_yes.
and now BAPI updating 'DL' properly but I have a doubt that it will take more time for program am not sure at this time becz I am waiting for more test data which get created by functional guy ,becz one test data can be used only once .
reg second issue as you suggested ," You try to create a batch for a material that is not batch managed. just try to create a batch for this material using the online transaction MSC1N, you should get the same message " so its seems data issue and not bapi issue right ? I have highlighted the same to functional consultant mean time can you suggest if any steps I can take
I Tried giving same material number , plant , batch in MSC1N to create but I got message
material XXXXXXX is not handled in batches in plant XXXX
Regards
Meeta
2015 Jan 17 4:59 PM
The BAPI will certainly need more time if you tell them to access each material master view.
Not sure if it is only a data issue, but for sure the batch management indicator is not active in the existing material master. You should probably react on this in your program and only execute the BAPI_BATCH_CREATE if you found a batch management indicator
2015 Jan 17 5:29 PM
Okey then how I can check that batch management indicator is active or not ?
else what I can write in code before calling BAPI BAPI_BATCH_CREATE