05-23-2006 3:04 PM
Hi all,
In a report when user clicks a push button then it prompts user to enter values in a dialog box say date and time .
Then i have to capture the values user entered and i have to submit these values to another executable program.
Is it possible if possible please tell me how to do it.
Thanks
chandu
05-23-2006 3:10 PM
hi,
when you click the button code for popup using the popup fm's or using the screen. capture the values what ever the user enters .and accordingly you can use submit to the program.
Regards
vijay
05-23-2006 3:06 PM
hi SAi,
1. SUBMIT rep.
2. SUBMIT (name).
Extras:
1. ... LINE-SIZE col
2. ... LINE-COUNT line
3. ... TO SAP-SPOOL List output to the SAP spool database
4. ... USING SELECTION-SCREEN scr
5. ... VIA SELECTION-SCREEN
6. ... AND RETURN
7. ... EXPORTING LIST TO MEMORY
8. ... USER user VIA JOB job NUMBER n
9. ...Various additions for passing parameters to rep
10. ... USING SELECTION-SETS OF PROGRAM prog
Effect
Calls report rep.
The system leaves the active program and starts the new report rep. In basic form 2, you can specify the name of the report in the field name. You must specify the name in uppercase, otherwise a runtime error occurs.
Note
You can only start programs with type '1' using SUBMIT. If the program has a different type, the system triggers a runtime error.
Please consult Data Area and Modularization Unit Organization documentation as well.
Addition 1
... LINE-SIZE col
Effect
The list generated by the report has the line width col.
Addition 2
... LINE-COUNT line
Effect
The list generated by the report has line lines per page.
Addition 4
... USING SELECTION-SCREEN scr
Effect
When you execute the report, the system uses the selection screen number that you specify in the scr field. This must be a selection screen defined using the SELECT-OPTIONS, PARAMETERS and SELECTION-SCREEN statements.If you omit the addition, the system uses the standard selection screen 1000.
This addition allows you to start the same report in different situations, using a different selection screen each time.
Notes
The addition VIA SELECTION SCREEN determines whether the report is processed in the foreground or the background.
What happens if the required screen does not exist or is not a selection screen?
Screen 1000:
If you want to use the standard selection screen (... USING SELECTION-SCREEN 1000 or do not specify a ... USING SELECTION-SCREEN) addition, the system does not process a selection screen.
Other selection screens:
The system triggers a runtime error.
Addition 5
... VIA SELECTION-SCREEN
Effect
The selection screen is displayed. In this case, the selection screen is displayed again after the report list has been displayed. The values entered by the user remain displayed.
Addition 6
... AND RETURN
Effect
Returns to the calling transaction or program after the called program has been executed. SUBMIT ... AND RETURN creates a new internal session.
Addition 7
... EXPORTING LIST TO MEMORY
Effect
Does not display the output list of the called report, but saves it in ABAP memory and leaves the called report immediately. Since the calling program can read the list from memory and process it further, you need to use the addition ... AND RETURN . Also, since the called report cannot be requested for printing, the addition ... TO SAP-SPOOL is not allowed here. In addition, you must not assign a function code to the ENTER key in the current GUI status. The saved list is read from the SAP memory using the function module 'LIST_FROM_MEMORY' and can then be saved to the database using EXPORT, for example. You can process this list further with the function modules 'WRITE_LIST', 'DISPLAY_LIST' ... of the function group "SLST".
Addition 8
... USER user VIA JOB job NUMBER n
Effect
Schedules the specified report in the job specified by the job name job and the job number n. The job runs under the user name user and you can omit the addition USER user. The assignment of the job number occurs via the function module JOB_OPEN (see also the documentation for the function modules JOB_CLOSE and JOB_SUBMIT). This addition can only be used with the addition ...AND RETURN.
Note
When scheduling a report with the SUBMIT ... VIA JOB job NUMBER n statement, you should always use the addition ...TO SAP-SPOOL to pass print and/or archive parameters. Otherwise, default values are used to generate the list and this disturbs operations in a production environment.
SY-SUBRC = 0:
Job scheduled successfully
SY-SUBRC = 4:
Job scheduling terminated by user
SY-SUBRC = 8:
Error in job scheduling (JOB_SUBMIT)
SY-SUBRC = 12:
Error in internal number assignment
Addition 10
... USING SELECTION-SETS OF PROGRAM prog
Effect
Uses variants of the program prog when executing the program rep.
Note
Important
The programs prog and rep must have the same SELECT-OPTIONS and PARAMETERs. Otherwise, variants of the program prog may be destroyed.
Note
When using this addition, the specified variant vari of the program prog is taken in USING SELECTION-SET vari. On the other hand, all variant-related actions on the selection screen of rep (Get, Save as variant, Display, Delete) refer to the variants of prog.
Example
SUBMIT REPORT01
VIA SELECTION-SCREEN
USING SELECTION-SET 'VARIANT1'
USING SELECTION-SETS OF PROGRAM 'REPORT00'
AND RETURN.
Effect
Executes the program REPORT01 with the variant VARIANT1 of the program REPORT00.
hope this helps,
priya.
05-23-2006 3:06 PM
05-23-2006 3:07 PM
You can define parameters with NO-DISPLAY and call the SUBMIT REPORT USING SELECTION-SCREEN scr
and pass the selection paramters date and time.
05-23-2006 3:08 PM
Call a screen with two fields i.e. date and time.
case sy-ucomm.
when 'BUT1'.
call screen '0100' STARTING AT x1 y1 ENDING AT x2 y2 .
endcase.
in that screen you can write your code to trsanfer the values entered on the screen into variables and return to the calling program once you do that.
Regards,
ravi
05-23-2006 3:09 PM
05-23-2006 3:10 PM
hi,
when you click the button code for popup using the popup fm's or using the screen. capture the values what ever the user enters .and accordingly you can use submit to the program.
Regards
vijay
05-23-2006 3:17 PM
Hi all,
Iam using call selection-screen
CALL SELECTION-SCREEN '0500' STARTING AT 13 7.
SELECTION-SCREEN BEGIN OF SCREEN 500 TITLE title
AS WINDOW.
SELECT-OPTIONS: date FOR sy-datum DEFAULT sy-datum OBLIGATORY,
time FOR sy-uzeit DEFAULT sy-uzeit OBLIGATORY.
SELECTION-SCREEN END OF SCREEN 500.
Please give me a piece of code how to capture the values user entered.
Thanks
chandu
05-23-2006 3:21 PM
Here is a sample program which uses a function module to throw the popup for values and brings them back. You can then use them values in your SUBMIT statement.
report zrich_0001 .
data: ivals type table of sval with header line.
data: x_datum type sy-datum,
x_uzeit type sy-uzeit.
start-of-selection.
* Add the fields that you want to be in the popup box
ivals-tabname = 'SYST'.
ivals-fieldname = 'DATUM'.
append ivals.
ivals-tabname = 'SYST'.
ivals-fieldname = 'UZEIT'.
append ivals.
* Throw the popup
call function 'POPUP_GET_VALUES'
exporting
* NO_VALUE_CHECK = ' '
popup_title = 'Enter Date & Time'
* START_COLUMN = '5'
* START_ROW = '5'
* IMPORTING
* RETURNCODE =
tables
fields = ivals
exceptions
error_in_fields = 1
others = 2
.
* Get the values from the POPUP and put them into
* local variables
read table ivals with key fieldname = 'DATUM'.
if sy-subrc = 0.
x_datum = ivals-value.
endif.
read table ivals with key fieldname = 'UZEIT'.
if sy-subrc = 0.
x_uzeit = ivals-value.
endif.
<b>* Here P_DATUM and P_UZEIT are define as PARAMETERS in
* the ZREPORT program</b>
submit zreport
with p_datum = x_datum
with p_uzeit = x_uzeit
and return.
Regards,
Rich Heilman
05-23-2006 5:31 PM
Hi rich,
Is there anyway to make the fields in popup obligatory.
thanks
05-23-2006 3:11 PM
05-23-2006 5:35 PM