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

Coverting material while passing to BAPI

Former Member
0 Likes
1,858

Hi,

Iam calling a BAPI for goods movement. For this iam passing my material number from a flat file. The BAPI only recognizing the material when it is in capitals, if the material number is in small letters it is not recognizing that material and displays a message like material doesn't exist. Do i have to convert the materials to caps before passing them to the BAPI. or is there any FM which converts the material into internal format.

Regards,

Anil.

Hi,

Iam calling a BAPI for goods movement. For this iam passing my material number from a flat file. The BAPI only recognizing the material when it is in capitals, if the material number is in small letters it is not recognizing that material and displays a message like material doesn't exist. Do i have to convert the materials to caps before passing them to the BAPI. or is there any FM which converts the material into internal format.

Regards,

Anil.

13 REPLIES 13
Read only

Former Member
0 Likes
1,754

You can Use FM: 'CONVERSION_EXIT_MATN1_INPUT'

Read only

0 Likes
1,754

Hi,

When i tested this FM its working fine. But in my program it is not working. Am still not able to convert it.

Regards,

Anil.

Read only

0 Likes
1,754

Hi

I hope this is how you are giving it.

ma = 'zapret'.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
  EXPORTING
    INPUT              = ma
 IMPORTING
   OUTPUT             = ma1
* EXCEPTIONS
*   LENGTH_ERROR       = 1
*   OTHERS             = 2
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

write: / ma1.

Regards,

Vishwa.

Edited by: Vishwa Sri Hari on Oct 27, 2008 10:58 AM

Read only

0 Likes
1,754

Hi viswa,

I am giving exactly as you mentioned. But in my case the output ma1 contains the same text which i passed with ma...

Regards,

Anil.

Read only

0 Likes
1,754

Hi Anil,

Have you tried using the code


TRANSLATE <fieldname> to UPPER CASE.

And then pass your fieldname to the BAPI.

I think this should work.

Cheers,

Vishnu

Read only

0 Likes
1,754

Oh ok. It is not getting converted to Capitals??. OK then

ma = 'zapret'.
 TRANSLATE ma TO UPPER CASE.

Try this...It should work.

Regards,

Vishwa.

Read only

0 Likes
1,754

what is the source , you are getting the material number. are you getting it from any flat file. or any database table.

Read only

0 Likes
1,754

Hi Vijay,

Iam getting the material from flat file. and needs to pass this to the BAPI in the corresponding item table.

In program when iam using the specified FM its not getting transalated automatically. But when i tested, it is working fine.

Regards,

Anil Reddy.

Read only

0 Likes
1,754

Did you try with TRANSLATE keyword.

Read only

0 Likes
1,754

Hi Viswa,

Using translate it is woking fine.

But i wonder why the FM is not working in the program.

Regards,

Anil.

Read only

0 Likes
1,754

Hi

Try with this FM otherwise:

po = 'zapret'.

CALL FUNCTION '2054_TRANSLATE_2_UPPERCASE'
  EXPORTING
    I_STRING            = po
 IMPORTING
   E_STRING            = po1.
* EXCEPTIONS
*   ERROR_OCCURED       = 1
*   OTHERS              = 2
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.



write: / po1.

Regards,

Vishwa.

Read only

Former Member
0 Likes
1,754

use the conversion routine function CONVERSION_EXIT_MATN1_INPUT to convert the material ,before passing it to BAPI parameters.

Read only

Former Member
0 Likes
1,754

Hi

Its true that you have to convert the material number into capitals...because it is case sensitive, and if you check in the master table it is stored in caps.

You can use the Key Translate to upper case....

Regards,

Vishwa.