‎2006 Aug 02 7:38 AM
Hello all
The Program Code Like This:
AT LINE-SELECTION.
DATA: FNAM(20) TYPE C,
FVAL(20) TYPE C.
GET CURSOR FIELD FNAM VALUE FVAL.
CASE FNAM.
WHEN 'ITAB-CHARG'.
SUBMIT ZRPP032_1 VIA SELECTION-SCREEN
WITH S_MATNR EQ ITAB-MATNR
WITH S_CHARG EQ ITAB-CHARG
AND RETURN .
WHEN OTHERS.
ENDCASE.
Please tell me how to do that the Report ZRPP032_1 auto run when i call it.
Thanks in advance.
‎2006 Aug 02 7:42 AM
You will have just take out the VIA SELECTION-SCREEN from the SUBMIT statement, then the report will be executed directly.
REgards,
Ravi
Note : Please mark all the helpful answers
‎2006 Aug 02 7:42 AM
You will have just take out the VIA SELECTION-SCREEN from the SUBMIT statement, then the report will be executed directly.
REgards,
Ravi
Note : Please mark all the helpful answers
‎2006 Aug 02 7:50 AM
Hi,
Consider these two programs I have done using both <b>WITH SELECTION-TABLE</b> and <b>IMPORT/EXPORT</b>.
In Program 1(ZZTEST_ARUN_1).
I have two radio buttons. If I select Material the program executes its own code. If I select plant data is fetched and exported to memory. Then it gets the selection parameters of the Program 2(ZZTEST_ARUN_2) through the FM RS_REFRESH_FROM_SELECTOPTIONS. Then I populate the values for selection screen and pass using the
SUBMIT....WITH SELECTION-TABLE option.
REPORT zztest_arun_1.
TABLES: t001w.
DATA : it_marc TYPE STANDARD TABLE OF marc WITH HEADER LINE,
it_werks TYPE STANDARD TABLE OF t001w WITH HEADER LINE.
PARAMETERS material RADIOBUTTON GROUP abc. "Material General Details
PARAMETERS plant RADIOBUTTON GROUP abc DEFAULT 'X'. "Material Plant Details
START-OF-SELECTION.
IF material EQ 'X'.
*If Material selected own code executes
SELECT * FROM marc INTO TABLE it_marc UP TO 200 ROWS .
LOOP AT it_marc.
WRITE :/ it_marc-matnr,
it_marc-werks.
ENDLOOP.
ENDIF.
IF plant EQ 'X'.
*If Plant selected data fetched
SELECT * FROM t001w INTO TABLE it_werks UP TO 50 ROWS.
*Exported to Memory
EXPORT it_werks[] TO MEMORY ID 'TEST'.
*Declare on selection table type RSPARAMS
DATA : stable LIKE rsparams OCCURS 0 WITH HEADER LINE.
*Call this FM to get the Selection screen details
*of Program ZZTEST_ARUN_2 (it returns Select Options, Parameters..)
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
curr_report = 'ZZTEST_ARUN_2'
TABLES
selection_table = stable
EXCEPTIONS
not_found = 1
no_report = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
stable-sign = 'I'.
stable-option = 'BT'.
* populate some selection condition
READ TABLE it_werks INDEX 10.
stable-low = it_werks-werks.
READ TABLE it_werks INDEX 40.
stable-high = it_werks-werks.
APPEND stable.
*Submit it then
SUBMIT zztest_arun_2
WITH SELECTION-TABLE stable
AND RETURN.
ENDIF.
<b>Second Program.</b>
REPORT zztest_arun_2.
TABLES: t001w.
DATA : it_werks TYPE STANDARD TABLE OF t001w WITH HEADER LINE.
SELECT-OPTIONS : s_werks FOR t001w-werks.
*Import the stored data.
IMPORT it_werks[] FROM MEMORY ID 'TEST'.
*Display the data based on selection criteria got
*form ZZTEST_ARUN_1
LOOP AT it_werks WHERE werks IN s_werks.
WRITE : / it_werks-werks,
it_werks-name1.
ENDLOOP.
Check this link for mpre details.
Regards,
Arun Sambargi.
‎2006 Aug 02 7:51 AM
Hi LIU,
You can use SUBMIT Statement without VIA SELECTION SCREEN or if any Custom transaction is created for program ZRPP032_1 then use CALL TRANSACTION <TRANSACTION NAME> AND SKIP FIRST SCREEN.
Syntax:
CALL TRANSACTION <tcod>
[AND SKIP FIRST SCREEN]
[USING <itab>].
Calls the transaction <tcod> while retaining the data in the calling program. At the end of the transaction, control returns to the point from which the transaction was called. The additions allow you to skip the first screen of the transaction or pass an internal table for batch input to it.
Syntax:
SUBMIT;
SUBMIT <rep> [AND RETURN] [VIA SELECTION-SCREEN]
[USING SELECTION-SET <var>]
[WITH <sel> <criterion>]
[WITH FREE SELECTIONS <freesel>]
[WITH SELECTION-TABLE <rspar>]
[LINE-SIZE <width>]
[LINE-COUNT <length>].
Calls the program <rep>. If you omit the AND RETURN addition, the current program is terminated, otherwise, the data from the current program is retained, and processing returns to the calling program when <rep> has finished running. The other additions control the selection screen and set attributes of the default list in the called program
The above mentioned Syntax can be used and is self Explanatory.
Hope this might help you!
Regards,
Prashanth
‎2006 Aug 02 7:54 AM
Hi
I guess S_MATNR and S_CHARG in program ZRPP032_1 are defined as select-options. If so, you have to pass it as ranges.
ranges: r_matnr like mara-matnr.
r_matnr-sign = 'I'.
r_matnr-option = 'EQ'.
r_matnr-low = itab-matnr.
append r_matnr.
--- similarly for charg if itz defined as select-option.
submit ZRPP032_1
with s_matnr in r_matnr
with s_charg in r_charg
and return.
Hope this will help you.
Thanks
Eswar
Note: Reward for useful replies
‎2006 Aug 02 8:03 AM
Hi Zhongming,
Try this:
AT LINE-SELECTION
DATA: FNAM(20) TYPE C,
FVAL(20) TYPE C,
GET CURSOR FIELD FNAM VALUE FVAL.
CASE FNAM.
WHEN 'ITAB-CHARG'.
SUBMIT ZRPP032_1 WITH S_MATNR EQ ITAB-MATNR WITH S_CHARG EQ ITAB-CHARG
AND RETURN .
WHEN OTHERS.
ENDCASE.
This Statement will call the output screen of Program ZRP032_1 and fill the values in S_MATNR and S_CHARG with values of ITAB_MATNR and ITAB-CHARG respectively and execute it immediately.
I hope it works.
Reward points if found useful.
Regards,
Amit.
‎2006 Aug 02 8:06 AM
If you want to run the report automatically remove the VIA SELECTION-SCREEN in the code.