cancel
Showing results for 
Search instead for 
Did you mean: 

How to fields by concatenate function in smartform

Former Member
0 Kudos

Hi all,

I want to fetch the rate of HRB1 or HRC1 (conditional type for Packing & fwd'ing) and display in the form output for each items available for single PO.....

i.e.,in my PO,has 3 diff items with diff Base UOM...

for 1st item:P&F amt is Rs:2000/-, UOM:TO, Qty:10

2nd item amt is Rs:10/- ,UOM:EA ,Qty:5

3rd Item amt is Rs:500/- ,UOM:EA, Qty:1

So i want to display it as

P&F: Rs.200 / TO

Rs:2 / EA

Rs:500 / EA..

and my code(its wrong....some more to change...but i declared to get for a single item 1st)...i've enlcosed below.

***************************************

select meins from ekpo into it_meins where ebeln = zxekko-ebeln.

endselect.

if sy-subrc eq 0.

move it_meins to i_meins.

endif.

select kbetr from konv into it_kbetr where knumv = zxekko-knumv

and kschl = 'HRB1' or kschl = 'HRC1'.

endselect.

if sy-subrc eq 0.

move it_kbetr to i_kbetr.

endif.

concatenate i_kbetr '/' i_meins into g_var1 separated by space.

****************************************************************************

but in output it display only the last item from the PO...but in rates itss giving wrong as"00021028 / EA " like that its giving...

What i've to do to get my result.....

Pls post ur comments in detail.....will reward u once i close this post.

thanks & regards

sankar

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member196280
Active Contributor
0 Kudos

Do it like this it will solve your problem...

select meins from ekpo into it_meins where ebeln = zxekko-ebeln.

endselect.

if sy-subrc eq 0.

move it_meins to i_meins.

endif.

select kbetr from konv into it_kbetr where knumv = zxekko-knumv

and kschl = 'HRB1' or kschl = 'HRC1'.

endselect.

**if sy-subrc eq 0.

IF NOT it_kbetr INITIAL.

LOOP AT it_kbetr.

move it_kbetr to i_kbetr.

concatenate i_kbetr '/' i_meins into g_var1 separated by space.

****************************************************************************

ENDLOOP.

endif.

Regards,

SaiRam

Former Member
0 Kudos

Hi sairam.R.N,

i did,but it shows an error saying that Relational Operator "INTIAL" is not supported.

and for ur info....in global def.,i declared

it_kbetr type kbetrit_meins type meins.

g_var1 type char25.

So what i do....next

Pls advise....

thanks & regards

sankar

former_member196280
Active Contributor
0 Kudos

Do it like this, create program lines and fetch the following data....

select meins from ekpo into it_meins where ebeln = zxekko-ebeln.

endselect.

if sy-subrc eq 0.

move it_meins to i_meins.

endif.

select kbetr from konv into it_kbetr where knumv = zxekko-knumv

and kschl = 'HRB1' or kschl = 'HRC1'.

endselect.

LOOP AT it_kbetr.

move it_kbetr to i_kbetr.

concatenate i_kbetr '/' i_meins into g_var1 separated by space.

    • create a new internal table and pass this g_var1 to the internal table.

ENDLOOP.

Now, I guess you might have created LOOP , templet or table in your smartform... pass this new internal table and display the value...

Note: new internal table will hold all the fields...

Close the thread once your question is answered.

Regards,

SaiRam

Former Member
0 Kudos

hi sairam,

im not getting u,correctly what u r trying to say....

if i declare an internal table like the below one

*******************************

data:begin of it_out occurs 0,

ebeln like ekpo-ebeln, or type char

knumv like konv-knumv,

kbetr type d value 2,

kwert type d value 2,

meins type ekpo-meins,

menge type ekpo-menge,

text(25),

end of it_out.

****************************

how can i call this in the my template (i used a template...under the window...and inside it goes -> code ->text...

tell me exactly....pass the g_var1 to which field in it_out int table.

if its text field.....is it right????

move g_var1 to it_out-text.

refresh g_car1.

Pls advise.

Expecting ur reply

thanks& regards

sankar

Former Member
0 Kudos

Hi sairam,

just check my message below/above along with this....

i declared the it_kbetr type kbetr and not an internal table....and in ur reply,

u've mentioned that loop at it_kbetr....how is it possible???

U want me to declarethe internal table as a loop....

i.e.,loop a it_out....am i right???

Do reply...

thanks & regards

sankar