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

ABAP code, solution OK?

Former Member
0 Likes
1,059

Hi,

I need to modify matnr. Is this code OK,

or do I have to use another LT_TABLE

and then append wa_lqua to new LT_TABLE?


  LOOP AT lt_lqua INTO wa_lqua.

    CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'
      EXPORTING
        input  = wa_lqua-matnr
      IMPORTING
        output = wa_lqua-matnr.

    MODIFY lt_lqua FROM wa_lqua INDEX sy-tabix.

  ENDLOOP.

tnx..Adibo.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,019

No need to use another table ...

10 REPLIES 10
Read only

Former Member
0 Likes
1,020

No need to use another table ...

Read only

Former Member
0 Likes
1,019

Hi Abido,

This code looks fine.

Read only

Former Member
0 Likes
1,019

HI, this is fine no need to use another internal table.

raj

Read only

Former Member
0 Likes
1,019

Hi,

Its good, no need of using another table.

Read only

Former Member
0 Likes
1,019

Hi,

This code is OK, it works fine.

No need of tab index number, if u still use it no problem. It is better to use transporting field for better performance.

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Jun 12, 2008 7:02 PM

Read only

Former Member
0 Likes
1,019

hii

simply use following code

just take that matnr in one variable.


w_matnr        LIKE mara-matnr,  " Material Number

lt_drad-objecttype = 'MARA'.
    w_matnr = ls_data-matnr.
    CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
      EXPORTING
        input        = w_matnr
      IMPORTING
        output       = w_matnr
      EXCEPTIONS
        length_error = 1.

    lt_drad-objectkey  = w_matnr.
    APPEND lt_drad.

<REMOVED BY MODERATOR>

thx

twinkal

Edited by: Alvaro Tejada Galindo on Jun 12, 2008 7:03 PM

Read only

Former Member
0 Likes
1,019

hi ,

you have the code right .

just i would like to add one addtion.

LOOP AT lt_lqua INTO wa_lqua.

CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'

EXPORTING

input = wa_lqua-matnr

IMPORTING

output = wa_lqua-matnr.

MODIFY lt_lqua FROM wa_lqua INDEX sy-tabix transporting matnr.

ENDLOOP.

the transporting addittion will have affect only the specified field.

Read only

ThomasZloch
Active Contributor
0 Likes
1,019

replace

MODIFY lt_lqua FROM wa_lqua INDEX sy-tabix.

with

MODIFY lt_lqua FROM wa_lqua TRANSPORTING matnr.

because the FM call might change the value of SY-TABIX.

Thomas.

Read only

Former Member
0 Likes
1,019

Hi,

1.It's enough for the removing leading zeroes.

Refer this:

https://forums.sdn.sap.com/click.jspa?searchID=12818061&messageID=3229017

Regards,

Shiva Kumar

Read only

Former Member
0 Likes
1,019

Hi All !! tnx!



  LOOP AT lt_lqua INTO wa_lqua.

    CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'
      EXPORTING
        input  = wa_lqua-matnr
      IMPORTING
        output = wa_lqua-matnr.

      MODIFY lt_lqua FROM wa_lqua TRANSPORTING matnr.

  ENDLOOP.