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: 

display problm in alv

former_member342013
Contributor
0 Kudos

hi

below is my code...

if i enter one plant in the selection screen then my prgrm works fine

now my prblm is in selection screen if i enetr more than 1 plant then i should get uot put as below

Process Order details for 1120,1130,1410

how to do this?

DATA: it_header TYPE slis_t_listheader,
      wa_header TYPE slis_listheader,
      werks1 TYPE eine-werks,
      werks2 TYPE eine-werks,
      t_text TYPE string.

    move i_werks-low to werks1.
  LOOP AT i_werks.
 CONCATENATE text-to1 ':' werks1 INTO t_text SEPARATED BY space.
 wa_header-typ = 'H'.
  wa_header-info = t_text.
  APPEND wa_header to it_header.
  CLEAR wa_header.
  ENDLOOP.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

First select the plants into a table using the select option field i_werks, and loop that internal table and concatenate.

Looping at the select option table i_werks will not work.

Regards

7 REPLIES 7

Former Member
0 Kudos
LOOP AT i_werks.

if sy-tabix = 1.
 CONCATENATE text-to1 ':' i_werks-low INTO t_text SEPARATED BY space.
else.
 concatenate t_text i_werks-low INTO t_text SEPARATED BY ','.
endif.
  wa_header-typ = 'H'.
  wa_header-info = t_text.
  APPEND wa_header to it_header.
  CLEAR wa_header.
  ENDLOOP.

Former Member
0 Kudos

Hi,

First select the plants into a table using the select option field i_werks, and loop that internal table and concatenate.

Looping at the select option table i_werks will not work.

Regards

0 Kudos

hi

Thanks for ur reply...

can u expln in breif plz....

0 Kudos

Hi,

Do similar to this

DATA : G_WERKS TYPE WERKS_D,
       IT_WERKS TYPE TABLE OF WERKS_D,
       WA_WERKS TYPE WERKS_D,
       TEXT     TYPE CHAR1024.

SELECT-OPTIONS : I_werks for g_werks.

SELECT WERKS
FROM T001W
INTO TABLE IT_WERKS
WHERE WERKS IN I_werks. " Table  IT_WERKS will contain plants based on user Input

LOOP AT IT_WERKS INTO WA_WERKS.

CONCATENATE TEXT WA_WERKS INTO TEXT SEPARATED BY SPACE.

ENDLOOP.

WRITE TEXT.

Use the variable TEXT in the header

Regards

Edited by: Rajvansh Ravi on Jun 16, 2009 8:41 AM

p244500
Active Contributor
0 Kudos

hi

you cant give like this, you have to CONCATENATE all the plant b4 pass the 'wa_header-info'


  move i_werks-low to werks1.
  move i_werks-high to werks2.

  
    CONCATENATE text-to1 ':' werks1 '-' werks2  INTO t_text SEPARATED BY space.
 
  wa_header-typ = 'H'.
  wa_header-info = t_text.
  APPEND wa_header to it_header.
  CLEAR wa_header.
  

regard

nawa.

kesavadas_thekkillath
Active Contributor
0 Kudos

first of all try to debug these kind of issues .. it will solve everything !!!!

move i_werks-low to werks1. <----werks 1 will always have only one plant

werks1 is never changed in the below statement

CONCATENATE text-to1 ':' werks1 INTO t_text SEPARATED BY space.

0 Kudos

place the move statement inside your loop .. it solves