cancel
Showing results for 
Search instead for 
Did you mean: 

reg.script

Former Member
0 Kudos

Hi Experts,

I want to add one field to form that is 'ekgrp' using ekko-ebeln. i written a code for this also .but in that code iam not getting ekko-ebeln value.so, iam not gettiing the out put . the code is as follows.

&----


*& Subroutine Pool ZAN_GOODS_RECEIPT

*&

&----


*&

*&

&----


PROGRAM ZAN_GOODS_RECEIPT.

*----


TABLES DECLARATION.

tables : likp,lips,ekko,ekpo.

*----


FORM STRUCTURE DECLARATION.

form f_head tables in_tab structure itcsy

out_tab structure itcsy.

*----


types declaration .

types:begin of gty_likp,

vbeln type likp-vbeln,

end of gty_likp,

begin of gty_lips,

vbeln type lips-vbeln,

vgbel type lips-vgbel,

end of gty_lips,

begin of gty_ekko,

ebeln type ekko-ebeln,

ekgrp type ekko-ekgrp,

end of gty_ekko,

begin of gty_output,

cno type mara-zeinr,

ekgrp type ekko-ekgrp,

end of gty_output.

*----


internal tables declaration.

data: gt_likp type standard table of gty_likp,

gt_lips type table of gty_lips,

gt_ekko type table of gty_ekko,

gt_output type table of gty_output.

*----


work area declaration.

data:gs_likp type gty_likp,

gs_lips type gty_lips,

gs_ekko type gty_ekko,

gs_output type gty_output.

*.............. constants declarations

data:gc_var(20) type c,

gc_var1(20) type c,

head type ekko-ekgrp.

select vbeln

into table gt_likp

from likp.

if sy-subrc = 0.

select vbeln

vgbel

into table gt_lips

from lips

for all entries in gt_likp

where vbeln = gt_likp-vbeln and

fkrel ='J'.

endif.

if sy-subrc = 0.

select ebeln

ekgrp

into table gt_ekko

from ekko

for all entries in gt_lips

where ebeln = gt_lips-vgbel.

endif.

read table in_tab with key 'GS_EKKO-EBELN'.

if sy-subrc = 0.

gc_var = in_tab-value.

endif.

read table gt_ekko into gs_ekko with key ebeln = gc_var binary search.

if sy-subrc = 0.

head = gs_ekko-ekgrp.

gC_var1 = head.

read table out_tab with key 'HEAD'.

if sy-subrc = 0.

move gc_var1 to out_tab-value.

modify out_tab index 1.

endif.

endif.

endform.

perform is as follows.

STORER &EKKO-EKGRP&

PERFORM F_HEAD IN PROGRAM ZAN_GOODS_RECEIPT

USING &EKKO-EBELN&

CHANGING &EKGRP&

ENDPERFORM.

thanks & regards,

Narasimha Rao,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

write the form as follows.f

Form f_head tables in_tab structure itcsy

out_tab structure itcsy.

data:l_ebeln(10) type n.

read table in_tab with key name = 'EKKO-EBELN'.

if sy-subrc = o.

l_ebeln = in_tab-value.

select ekgrp

from ekko

into l_ekgrp

where ebeln = l_ebeln.

endif.

read table out_tab with key name = 'EKGRP'

if sy-subrc = 0.

out_tab-value = l_ekgrp.

modify out_tab.

endif.

endform.

write perform as follows in script.

PERFORM F_HEAD IN PROGRAM ZAN_GOODS_RECEIPT

USING &EKKO-EBELN&

CHANGING &EKGRP&

ENDPERFORM.

STORER &EKGRP&

Thanks ,

NN.

Answers (0)