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

Re: leading zero's

Former Member
0 Likes
602

Hi Expert,

I have written one query with some variable and i am taking that variable into my message to display the message.When the message is displaying there are some zeros are display with matnr filed

Note: In the below concatenate statement the field WA_LIPS-MATNR is displaying with zeros in the output.

   select single matnr
                  werks
                  lgort
                  charg
                  from mchb_charg into  wa_mchb  where matnr = wa_lips-matnr
                                 and werks = wa_lips-werks
                                  and lgort = wa_lips-lgort
                                  and charg = wa_lips-charg
                                  and matnr = wa_lips-matnr.


    IF LV_XCHPF eq 'X' AND wa_mchb-charg is initial.
  CONCATENATE 'Batch #' wa_lips-charg 'does not exit for material' wa_lips-matnr 'in storage location'  wa_lips-lgort '&Plant' wa_lips-werks into LV_MESSAGE SEPARATED BY SPACE.
        MESSAGE LV_MESSAGE TYPE 'E'.
      ENDIF.
      endif.

Regards,

Addu


1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
559

You could :

- Convert MATNR with a WRITE statement to a character work area (or a call to conversion exit like CONVERSION_EXIT_MATN1_OUTPUT,  check domain MATNR definition)

WRITE wa_lips-matnr TP wa_matnr_c.

CONCATENATE 'Batch #' wa_lips-charg 'does not exit for material' wa_matnr_c 'in storage location'  wa_lips-lgort '&Plant' wa_lips-werks

  INTO lv_message SEPARATED BY SPACE.

- Create a message in a customer class with parameters

* SE91 : ZCLASS 999 "Batch &1 doesn''t exist for material &2 in storage location &3 Plant &4.

MESSAGE e999(zclass) WITH wa_lips-charg wa_lips-matnr wa_lips-lgort wa_lips-werks.

Regards,

Raymond

Hi Expert,

I have written one query with some variable and i am taking that variable into my message to display the message.When the message is displaying there are some zeros are display with matnr filed

Note: In the below concatenate statement the field WA_LIPS-MATNR is displaying with zeros in the output.

   select single matnr
                  werks
                  lgort
                  charg
                  from mchb_charg into  wa_mchb  where matnr = wa_lips-matnr
                                 and werks = wa_lips-werks
                                  and lgort = wa_lips-lgort
                                  and charg = wa_lips-charg
                                  and matnr = wa_lips-matnr.


    IF LV_XCHPF eq 'X' AND wa_mchb-charg is initial.
  CONCATENATE 'Batch #' wa_lips-charg 'does not exit for material' wa_lips-matnr 'in storage location'  wa_lips-lgort '&Plant' wa_lips-werks into LV_MESSAGE SEPARATED BY SPACE.
        MESSAGE LV_MESSAGE TYPE 'E'.
      ENDIF.
      endif.

Regards,

Addu


2 REPLIES 2
Read only

davis_raja
Active Participant
0 Likes
559

Dear,

     You can use the FM CONVERSION_EXIT_ALPHA_OUTPUT on the WA_LIPS-MATNR value to delete the leading zeroes.

Regards

Davis

Read only

RaymondGiuseppi
Active Contributor
0 Likes
560

You could :

- Convert MATNR with a WRITE statement to a character work area (or a call to conversion exit like CONVERSION_EXIT_MATN1_OUTPUT,  check domain MATNR definition)

WRITE wa_lips-matnr TP wa_matnr_c.

CONCATENATE 'Batch #' wa_lips-charg 'does not exit for material' wa_matnr_c 'in storage location'  wa_lips-lgort '&Plant' wa_lips-werks

  INTO lv_message SEPARATED BY SPACE.

- Create a message in a customer class with parameters

* SE91 : ZCLASS 999 "Batch &1 doesn''t exist for material &2 in storage location &3 Plant &4.

MESSAGE e999(zclass) WITH wa_lips-charg wa_lips-matnr wa_lips-lgort wa_lips-werks.

Regards,

Raymond