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: 

BAPI Material Save isuue -first specify main EAN for EA ?

0 Kudos

Hi Experts,

I am facing an issue while updating a material from .NET using BAPI_MATERIAL_SAVEDATA, I am passing below parameters to BAPI.

INTERNATIONALARTNOS

EAN_CAT: CQ

EAN_UPC: 6900320018997

UNIT:EA

UNITSOFMEASURE:

EAN_UPC:6900320018997

EAN_CAT:UC

ALT_UNIT: EA

UNITSOFMEASUREX:

EAN_UPC: X

EAN_CAT: X

ALT_UNIT: EA

and I am facing an error saying that 'First specify the main EAN for the unit EA'.

Can you help on this ??

2 REPLIES 2

Former Member
0 Kudos

Hi Ashok,

Please refer https://scn.sap.com/thread/1252710

It has the same issue as yours and resolution too.

BR,

Ankit.

Former Member
0 Kudos

Hi Ashok,

UNIT, ALT_UNIT  both field have "Convers. Routine" , so before you pass the value into above tabular parameter use below FM.

                      data element           domain            FM

UNIT               MEINH                   MEINS         CONVERSION_EXIT_CUNIT_INPUT

ALT_UNIT       LRMEI                    MEINS         CONVERSION_EXIT_CUNIT_INPUT

Example :

DATA: S_UNITSOFMEASURE  LIKE BAPI_MARM     OCCURS 0 WITH HEADER LINE,                             S_UNITSOFMEASUREX LIKE BAPI_MARMX   OCCURS 0 WITH HEADER LINE.


LOOP AT UNITSOFMEASURE.

    CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'

      EXPORTING

        INPUT          =  UNITSOFMEASURE-ALT_UNIT   " Alternative Unit of Measure

      IMPORTING

        OUTPUT         = S_UNITSOFMEASURE-ALT_UNIT    " Alternative Unit of Measure

      EXCEPTIONS

        UNIT_NOT_FOUND = 1

        OTHERS                = 2.

MOVE S_UNITSOFMEASURE-ALT_UNIT    TO S_UNITSOFMEASUREX-ALT_UNIT.     "  AUM

ENDLOOP .

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

    EXPORTING

......................

.......................

IMPORTING

      RETURN               = BAPIMSG

TABLES

........................................

......................................

      UNITSOFMEASURE       = S_UNITSOFMEASURE

      UNITSOFMEASUREX      = S_UNITSOFMEASUREX

.

Regard's

Smruti