05-31-2010 10:23 AM
All.
I have program A and program B. While executing Program A i need to call a perform (form) from Program B and result out this needs to flow into program A
Like Program B having a form f_select_data
form f_select_data.
select * from mara into table it_mara
where matnr in s_matnr
endform.
I need to call this from program A and results back to A
a®
05-31-2010 10:35 AM
Hi,
You can call like below
PERFORM f_select_data N PROGRAM B.
ie.,
PERFORM form IN PROGRAM prog.
Regards
Nehruu
05-31-2010 10:27 AM
Hi,
Why can't you use the IMPORT and EXPORT parameters to get the data from Program B to Program A.
Regards
Thiru
05-31-2010 10:33 AM
Hi,
To call the form f_select_data in program A. Use the below syntax
PERFORM <f_select_data> IN PROGRAM <program_b>.
This is called as external subroutine.
Regards
Dillip Sahoo
05-31-2010 10:35 AM
Hi,
You can call like below
PERFORM f_select_data N PROGRAM B.
ie.,
PERFORM form IN PROGRAM prog.
Regards
Nehruu
05-31-2010 10:39 AM
05-31-2010 10:49 AM
All,
I specified specifically in my query that i want the results back. all the above said statements not returning results back.
a®
05-31-2010 12:09 PM
hi
look at this example:
REPORT ZREP1.
perform get(ZREP2).
field-symbols <f1> type mara.
data fs(20) value '(ZREP2)zmara'.
assign (fs) to <f1>.
write: / <f1>-matnr
REPORT ZREP2 .
data: zmara type mara.
form get.
select single * from mara into zmara.
endform
reagards,darek
06-03-2010 7:08 AM
Darek,
Thanks , Your suggestion really worked out.
Issue resolved
a®
05-31-2010 10:40 AM
Hi,
write this in program A.
perform <form name>
in program <program B name> using <xyz>.
then write form in program B
form <form name> using <abc>.
endform.
Jitendra
Edited by: Jitendra Singh on May 31, 2010 11:44 AM
05-31-2010 10:43 AM
How about to include the program B in A. and call perform statement from A?
p.s. i believe your user ID and pwd has not been hacked
Cheers
05-31-2010 10:52 AM
I cannot able to include Program B in A because Program B is report program.
and Export/Import cannot be used due to program B is a standard program.
a®
05-31-2010 12:57 PM
> p.s. i believe your user ID and pwd has not been hacked
I'm not so sure either...language and level of expertise does not seem to correspond to what I've seen during many years here. Maybe a®s can comment?
Thomas
05-31-2010 10:43 AM
Export and Import would do...but we must modify the program B.
@ars - One way i think is get data and set data .. in a same function pool.
or globbal class to get data and set data.
HI amit .... thats a good idea
Edited by: Keshav.T on May 31, 2010 3:18 PM
05-31-2010 10:53 AM
HI
data : it_final type standard table of sflight.
perform Form_name(Program_name) tables it_final.
in other program
data : it_Final type standard table of sflight.
form vc_confirmation tables it_final1 like it_final.
"
"
"
" Lets say in this step your final Table gets filled,
"Amit Wrote
"p.s. i believe your user ID and pwd has not been hacked ;-)
" Even for a bit of time I am afraid to Post
endform.
Cheerz
Ram
05-31-2010 12:40 PM
Hi,
Kindly explore the usage of SUBMIT statement to call an executable report from another program.
eg : program B
parameter p1(5) type c..
start-of-selection.
write p1.
to call prog B execute program A with the following syntax.
SUBMIT <program B> WITH p1 = 'hello' and RETURN.
Regards
Siva
Edited by: Sivaprasad ML on May 31, 2010 5:13 PM
Edited by: Sivaprasad ML on May 31, 2010 5:28 PM
Edited by: Sivaprasad ML on May 31, 2010 5:32 PM
05-31-2010 1:22 PM
Hi
Try to below syn...
SUBMIT (p_prog)
WITH dd_kunnr-low EQ t_cli-kunnr
WITH dd_bukrs-low EQ p_bukrs
WITH p_langu EQ t_cli-lang
WITH x_opsel EQ 'X'
WITH x_shbv EQ 'X'
WITH pa_vari EQ g_vari
WITH pa_stida EQ p_date
TO SAP-SPOOL
SPOOL PARAMETERS s_pri_params
WITHOUT SPOOL DYNPRO
AND RETURN.
Thanks
Regards.
I.Muthukumar.
05-31-2010 2:16 PM
Hello ars,
Why don't you do like this.
Program A:
REPORT ZAK_A.
DATA: gv_field TYPE STRING VALUE '(ZAK_B)GT_MARA'.
FIELD-SYMBOLS: <fs_field> TYPE ANY TABLE.
PERFORM abc(ZAK_B).
ASSIGN (gv_field) TO <fs_field>.
Program B (Standard):
REPORT zak_b.
DATA: gt_mara TYPE TABLE OF mara.
FORM abc.
SELECT * FROM mara INTO TABLE gt_mara UP TO 10 ROWS.
ENDFORM.
05-31-2010 2:22 PM
09-17-2014 12:41 PM
Try this:.
In Z_PROGRAM use function
..PERFORM get_data_from_z_program in Y_PROGRAM.
In Y_PROGRAM write:
FIELD-SYMBOLS: <qals>. (example for qals table)
* inspection lot data
DATA: t_qals LIKE qals OCCURS 0 WITH HEADER LINE.
DATA: wa_qals LIKE LINE OF t_qals.
ASSIGN ('(Z_PROGRAM)QALS[]') TO <qals>.
IF NOT ( <qals> IS INITIAL ) .
t_qals[] = <qals>.
READ TABLE t_qals INTO wa_qals INDEX 1.
IF sy-subrc = 0.
qals = wa_qals.
ENDIF.
ENDIF.
hope helps..