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

Parameter id MAT incorrectly carries lexicographical material number

Former Member
0 Likes
2,068

Hello,

I call MM03 from an ABAP report using the following code.

SET PARAMETER ID 'MAT' FIELD p_value.

CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

Here p_value carries a value '123456-789-012'.

In MM03 screen this value is incorrectly populated as '6-789- -012-'

Suspecting something could be wrong with the ABAP program I tried populating the same parameter value as user default in my user profile.

When I access MM03 manually it carries the same incorrect value.

In SAP program SAPLOMCV / Include LOMCVU02 / Function CONVERSION_EXIT_MATN1_OUTPUT, the below code seems to come up with this result.

      LNG_E = LMATNR. (material DB length = 18)

      LNG_A = TMCNV-LMATNR. (configured length = 15)

      OFF_A = LNG_A - 1.

      OFF_E = LNG_E - 1.

      OFF_S = TMCNV-LMASKE - 1.

      WHILE OFF_A GE 0 AND

            OFF_E GE 0.

        case lv_kind.

          when cl_abap_datadescr=>typekind_string.

            lv_input_help = INPUT+OFF_E(1).

            assign lv_input_help to <e_ptr>.

          when others.

            ASSIGN INPUT+OFF_E(1)  TO <E_PTR>.    "-> lfd. Eingabebyte

          endcase.

        ASSIGN WORK+OFF_A(1)   TO <A_PTR>.    "-> lfd. Ausgabebyte

        IF OFF_S GE 0.

          ASSIGN TMCNV-MASKE+OFF_S(1)  TO <S_PTR>.  "-> lfd. Zeiche

        ENDIF.

        IF <S_PTR> CO EDITZE.          "Ziffernauswahlzeichen

          MOVE <E_PTR> TO <A_PTR>.     "Ziffer Input -> Output

          OFF_E = OFF_E - 1.           "Offset nächste Ziffer

        ELSE.                          "sonst

          MOVE <S_PTR> TO <A_PTR>.     "Zeichen aus Schab -> Output

        ENDIF.

        IF OFF_S EQ 0.                 "Ende der Schablone

          ASSIGN ' ' TO <S_PTR>.       "->Blank für Aufbereitung

        ENDIF.

        OFF_S = OFF_S - 1.             "Offset nächstes Schab-Zeichen

        OFF_A = OFF_A - 1.             "Offset nächstes Ausgabebyte

        IF OFF_E LT OFF_1ST.           "Nach 1.signifikanter Ziffer

          EXIT.                        "abbrechen

        ENDIF.

      ENDWHILE.

Looks like a bug to me. Your thoughts?

UV

4 REPLIES 4
Read only

JL23
Active Contributor
0 Likes
986

Please tell the content of customizing transaction OMSL

I guess you have a template defined, but this does not mean that the number is stored with dashes in the table

and it is not necessary to enter the number with dashes,

It is mainly used when a material number is shown to the user.

You could have tried with p_value = 123456789012

Read only

Former Member
0 Likes
986

Thanks Juergen for your reply.

OMSL

Material length = 15

Format = As specified in my post

Lexicographical = not checked

Leading zeros = checked

Good suggestion. Sure I could replace the dashes and try but my point is one should not have to.

Conversion exits does not work too.

Share your thoughts.

Read only

Former Member
0 Likes
986

Further update.

If I pass p_value as '123456789012' the result is even more bizarre. I see '012   -    -' in MM03.

If I pass p_value as '000123456789012' it seems to work. But if there is an org or view pop-up in MM03 and I cancel the pop-up, the value changes to '123456- 789-0 1'.

Very strange behavior.

Read only

JL23
Active Contributor
0 Likes
986

I expected that '000123456789012' is the correct input format, it is how the number is stored in field MARA-MATNR.

the CONVERSION_EXIT_MATN1_OUTPUT is supposed to transform the internal value into the display format like defined in the format field of OMSL

the other way around is probably achieved with CONVERSION_EXIT_MATN1_INPUT