Skip to Content
author's profile photo Former Member
Former Member

reg.script

Hi Experts,

iam modyfing one script , i want to add one field in the inf.window. so, iam writing a subroutine pool, i written the code, the code is given below . in that code , how i will assign the ekgrp to in_tab and out_tab.if any corrections is there please correct that .

&----


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

*loop at gt_likp into gs_likp.

*read table gt_lips into gs_lips with key vbeln = gs_likp-vbeln binary search.

read table gt_ekko into gs_ekko with key ebeln = gs_lips-vgbel binary search.

if sy-subrc = 0.

move: gs_ekko-ekgrp to gs_output-ekgrp.

append gs_output to gt_output.

endif.

*endloop.

endform.

rewards are helpful answers.

Thanks& regards,

Narasimha Rao.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 30, 2008 at 06:38 AM

    Hi,

    In the script you might be calling the subroutine as

    /:perform sub in program zname

    /: using &ekko-ebeln&

    /:changing &ekgrp&

    /:endperform.

    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.

    if sy-subrc = 0.

    read table out_tab with key name = 'EKGRP'.

    if sy-subrc = 0.

    move gs_ekko-ekgrp to out_tab-value.

    modify out_tab.

    endif.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 30, 2008 at 04:52 AM

    Hello,

    please do follow the pseudo code

    In the sub routine program.

    form get_cc_name

    tables in_par_tab structure itcsy

    out_par_tab structure itcsy.

    read table in_par_tab with key name = 'BUKRS'.

    if sy-subrc <> 0.

    exit.

    endif.

    bukrs = in_par_tab-value.

    and so on for all the values that are passed from the sap script

    loop at out_par_tab.

    if out_par_tab-name = 'NAME'.

    move adrc-name1 to out_par_tab-value.

    modify out_par_tab.

    endif.

    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.