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.