cancel
Showing results for 
Search instead for 
Did you mean: 

Hi all......Pls help me on the coding enlcosed here for PO smartform

Former Member
0 Kudos

Hi all...

In the below code.....i'm trying to get the datas from kbetr and meins for each item available in the PO....condition to HRB1 or HRC1...

while checking it where available or not in the debugging process....im getting the datas in the it_out table fields clearly but it isn't transporting it to the G_var1 of concatenate function....and also...its taking the records of the lkast item from the PO and also it display like this

"it_out-kbetr = 00021508/- " but in my PO it has 200/-

"it_out-meins = EA" but in my PO different UOM available for items like KG,TO,EA

Just go thru the below code...and do ur replies clearly....able to fix it. my requirement is or i want to display the output in the form is...(say if my PO has 3 items)

P&F: Rs.200 / TO

Rs:2 / EA

Rs:500 / EA..

*******************coding in my smartform

data:begin of it_out occurs 0,

ebeln like ekpo-ebeln,

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.

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.

loop at it_out.

*move it_kbetr to i_kbetr.

concatenate i_kbetr '/' i_meins into it_out-text separated by space.

move it_out-text to g_var1.

*refresh it_out.

endloop.

*endif.

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

Pls do the needful.

thanks & regards

sankar

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

1. First of all u havnt mentioned the type for it_meins and it_kbetr tables.

2. While u shud knw that SELECT.. ENDSELECT works as a loop so if there are multiple records for same EBELN then wat u get in i_meins and i_kbetr is the last value for that respective ebeln

So first specify properly wat u actually need

Former Member
0 Kudos

it_kbetr,it_kwert,i_meins and i_menge are the types of the respective field,i have declared in my smartform global def...

it_kwert type kwert

it_meins type meins

it_kbetr type kbetr

it_menge type menge

i_meins type char3

i_kbetr type p

so thru SELECT im moving the datas from it_meins to i_meins after the table

ans same like it_kbetr to i_kbetr.

then in concatenate under loop stmt....moving to g_var1.

while debugging, the data of my last item(as per PO)is getting to my i_meins and i_kbetr but its not moving to it_out-text or g_var1....

hope u understand now....else i'll again msg u very clearly in detail....all the coding part in my SF.

pls advise....

thanks & regards

sankar