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 one form. for that one i written one subroutine pool .iam sending the code please correct that one if any error is there please tell me.

rewards are help ful answers.

&----


*& 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.

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.

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 name = 'EKKO-EBELN'.

if sy-subrc = 0.

read table gt_ekko into gs_ekko with key ebeln = in_tab-value binary search.

endif.

if sy-subrc = 0.

read table out_tab with key name = 'EKGRP'.

endif.

if sy-subrc = 0.

move gs_ekko-ekgrp to out_tab-value.

modify out_tab.

endif.

endform.

and perform statement is as follows.

STORER &EKKO-EKGRP&

PERFORM F_HEAD IN PROGRAM ZAN_GOODS_RECEIPT

USING &EKKO-EBELN&

CHANGING &EKGRP&

ENDPERFORM.

thanks and regards,

Narasimha Rao.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Narasimha,

After this

form f_head tables in_tab structure itcsy

out_tab structure itcsy.

*declare work area for itcsy strct too..

data wa_in_tab like line of in_tab.

data wa_out_tab like line of out_tab.

constants : c_zero type i value '0'.

*as from Form we will get EKKO-EBELN first read it and pass *it to a variable..tp_ebeln

data : tp_ebeln type ekko-ebeln.

*then read the in_tab

read table in_tab index 1 into wa_in_tab.

if sy-subrc eq c_zero.

tp_ebeln = wa_in_tab-value.

endif.

  • then select data from likp using wher condition..

select vbeln into table gt_likp from likp.

  • likp which is the field is equal to EKKO-EBELN...

regards,

sg

Answers (0)