Application Development and Automation 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: 
Read only

bapi_material_savedata + cfop + foreign trade export

Former Member
0 Likes
601

Hi people!!!

Any help, please...

I'm using Bapi: bapi_material_savedata. all the fields are filled and saved except MARC-INDUS, MBEW-MTUSE, MBEW-MTORG, MBEW-OWNPR cfop fields ( foreign trade export and Accounting 2 screens).

SAP: ECC 6.0

Data in bapi structure:

  • Material CFOP category

SHIFT tg_marc-indus RIGHT DELETING TRAILING space.

TRANSLATE tg_marc-indus USING ' 0'.

tg_plantdata-mat_cfop = tg_marc-indus. " 00, 01, etc

tg_plantdatax-mat_cfop = c_x.

  • Usage of the material

IF NOT tg_mbew-mtuse IS INITIAL.

tg_valuationdata-matl_usage = tg_mbew-mtuse.

tg_valuationdatax-matl_usage = c_x.

ELSE.

tg_valuationdata-matl_usage = '1'.

tg_valuationdatax-matl_usage = c_x.

ENDIF.

  • Origin of the material

IF NOT tg_mbew-mtorg IS INITIAL.

tg_valuationdata-mat_origin = tg_mbew-mtorg.

tg_valuationdatax-mat_origin = c_x.

ELSE.

tg_valuationdata-mat_origin = '0'.

tg_valuationdatax-mat_origin = c_x.

ENDIF.

  • Produced in-house

IF ( tg_mara-mtart = c_zfpa ) OR

( tg_mara-mtart = c_zfsa ).

tg_valuationdata-in_house = c_x.

tg_valuationdatax-in_house = c_x.

ELSE.

tg_valuationdata-in_house = ''.

tg_valuationdatax-in_house = c_x.

ENDIF.

tg_valuationdata-orig_mat = ''.

tg_valuationdatax-orig_mat = c_x.

What's wrong?

Can anybody help me, please?

Regards!!!

Hi people!!!

Any help, please...

I'm using Bapi: bapi_material_savedata. all the fields are filled and saved except MARC-INDUS, MBEW-MTUSE, MBEW-MTORG, MBEW-OWNPR cfop fields ( foreign trade export and Accounting 2 screens).

SAP: ECC 6.0

Data in bapi structure:

  • Material CFOP category

SHIFT tg_marc-indus RIGHT DELETING TRAILING space.

TRANSLATE tg_marc-indus USING ' 0'.

tg_plantdata-mat_cfop = tg_marc-indus. " 00, 01, etc

tg_plantdatax-mat_cfop = c_x.

  • Usage of the material

IF NOT tg_mbew-mtuse IS INITIAL.

tg_valuationdata-matl_usage = tg_mbew-mtuse.

tg_valuationdatax-matl_usage = c_x.

ELSE.

tg_valuationdata-matl_usage = '1'.

tg_valuationdatax-matl_usage = c_x.

ENDIF.

  • Origin of the material

IF NOT tg_mbew-mtorg IS INITIAL.

tg_valuationdata-mat_origin = tg_mbew-mtorg.

tg_valuationdatax-mat_origin = c_x.

ELSE.

tg_valuationdata-mat_origin = '0'.

tg_valuationdatax-mat_origin = c_x.

ENDIF.

  • Produced in-house

IF ( tg_mara-mtart = c_zfpa ) OR

( tg_mara-mtart = c_zfsa ).

tg_valuationdata-in_house = c_x.

tg_valuationdatax-in_house = c_x.

ELSE.

tg_valuationdata-in_house = ''.

tg_valuationdatax-in_house = c_x.

ENDIF.

tg_valuationdata-orig_mat = ''.

tg_valuationdatax-orig_mat = c_x.

What's wrong?

Can anybody help me, please?

Regards!!!

1 REPLY 1
Read only

Former Member
0 Likes
481

Sandra, morning.

Do you managed to find the solution?

I have the same problem.

Could you help me?

Tks

Lucas