Application Development 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: 

ABAP code, solution OK?

Former Member
0 Kudos
156

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

Former Member
0 Kudos
116

No need to use another table ...

10 REPLIES 10

Former Member
0 Kudos
117

No need to use another table ...

Former Member
0 Kudos
116

Hi Abido,

This code looks fine.

Former Member
0 Kudos
116

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

raj

Former Member
0 Kudos
116

Hi,

Its good, no need of using another table.

Former Member
0 Kudos
116

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

Former Member
0 Kudos
116

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

Former Member
0 Kudos
116

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.

ThomasZloch
Active Contributor
0 Kudos
116

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.

Former Member
0 Kudos
116

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

Former Member
0 Kudos
116

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.