Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Selection screen and smartforms

Former Member
0 Likes
939

Hi,

Can somebody share with me simple eg to

enter data via the selection screens and then pass those values to smartform.

i have used the following code.But whenever i execute it the smartform opens first. i want to open the selection screen first.Then after entering the data there ,the smartorm must open up with the entered values.

PARAMETER P_PARAM1 TYPE MYTABLE-COL1.

PARAMETER P_PARAM2 TYPE MYTABLE-COL2.

AT SELECTION-SCREEN OUTPUT.

CALL FUNCTION '........................................'

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

PARAM1 = P_PARAM1

PARAM2 = P_PARAM2

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

  • EXCEPTIONS

  • FORMATTING_ERROR = 1

  • INTERNAL_ERROR = 2

  • SEND_ERROR = 3

  • USER_CANCELED = 4

  • OTHERS = 5

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Thanks & Regards

Jay

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
713

Hi,

Call the smartform in the event

START-OF-SELECTION.

instead of AT SELECTION-SCREEN OUTPUT.

Regards,

Madhukar Shetty

3 REPLIES 3
Read only

Former Member
0 Likes
714

Hi,

Call the smartform in the event

START-OF-SELECTION.

instead of AT SELECTION-SCREEN OUTPUT.

Regards,

Madhukar Shetty

Read only

Former Member
0 Likes
713

Hi,

As asked I am sending this piece of a code so that you can get a clear idea for the same.If you face the difficulty again please let me know.

selection-screen begin of block b1 with frame title text-001.

parameters :

p_carrid type spfli-carrid. " Carrier Id.

selection-screen end of block b1.

----


  • Working variable

----


data:

f_name type rs38l_fnam. " function module name

start-of-selection.

perform open_smartforms.

**************************************************************************************

form open_smartforms .

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = '<formname>''

  • VARIANT = ' '

  • DIRECT_CALL = ' '

importing

fm_name = f_name

exceptions

no_form = 1

no_function_module = 2

others = 3

.

if sy-subrc <> 0.

message id sy-msgid type 'S' number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif. " IF sy-subrc ne 0

call function f_name

exporting

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

p_carr = p_carrid

exceptions

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

others = 5

.

if sy-subrc ne 0.

message id sy-msgid type 'S' number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif. " IF sy-subrc ne 0

endform. " OPEN_SMARTFORMS

Regards,

Suvajit.

Read only

Kiran_Valluru
Active Contributor
0 Likes
713

Hi..

In the 3rd line of ur code i.e AT SELECTION-SCREEN OUTPUT

this means before processing the selection screen .. so before processing the selection screen , You are calling the smart -form ..!! that's why it is displaying smart form before selection screen..!!

I suggest u to put a button in selection screen.. so that when u press the button the entered values ll be shown in smartform..!!

pls go through the below code..

SELECTION-SCREEN BEGIN OF BLOCK B1.

PARAMETER P_PARAM1 TYPE MYTABLE-COL1.

PARAMETER P_PARAM2 TYPE MYTABLE-COL2.

SELECTION-SCREEN PUSHBUTTON /10(10) BUT1 USER-COMMAND B1. " this is for button

SELECTION-SCREEN END OF BLOCK B1.

AT SELECTION-SCREEN.

CASE SY-UCOMM.

WHEN 'B1'. " this means when u press the button this will execute..

CALL FUNCTION '...................................... ' your function module here..

ENDCASE.

INITIALIZATION.

BUT1 = 'Show'. " this is for initializing the value of button ..

Hope this ll help u..

Pls reply me if u need some more clarifications..!!

Regards,

Kiran

Edited by: kiran6 on Dec 13, 2010 9:56 PM