Application Development 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: 

Entered values are retained in the selection screen.

Former Member
0 Kudos

AT SELECTION-SCREEN.

in validating some issues.

Thje statement

" LEAVE TO TRANSACTION 'ZGXXXXX'. "

is going to initial seletion screen , But entered values are retained in the selection screen.

How can I make entered values to retain in the selection screen.

Could you please suggest me correct statement.

THANKS IN ADVANCE.

17 REPLIES 17

Former Member
0 Kudos

Do you want to retain or eliminate the values?

Thanks,

Santosh

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

I don't really understand why are you LEAVE the transaction, but you can use MEMORY IDs to set the fields.

report zrich_0001 .

parameters: p_chk1 type c memory id ck1,
            p_chk2 type c memory id ck2,
            p_chk3 type c memory id ck3.

at selection-screen.


  set parameter id 'CK1' field p_chk1.
  set parameter id 'CK2' field p_chk2.
  set parameter id 'CK3' field p_chk3.


  leave to transaction 'ZGXXXXX'.

Regards,

Rich Heilman

Former Member
0 Kudos

Thank you Rich.

But I have select-options also in my selection screen.

Could you please help me for select options also ?

0 Kudos

That will be a little trickier, I do think that we can preserve the value in the fields, but not all of the possible multple selections and stuff like that. I think we should start looking at the reason why you are leaving the transaction. If we can get away from doing that, then we can preserve all of the input values without any addtional coding.

Please give me some idea of the requirement and why you feel that you need to use the LEAVE TO TRANSACTION statement. If you can, pleae post all of the code.

Regards,

RIch Heilman

0 Kudos

Check this link for select-options:

Thanks,

Santosh

Former Member
0 Kudos

AT SELECTION-SCREEN.

PERFORM check_prepare_step.

PERFORM get_zgbsis.

form check_prepare_step .

DATA : wa_zgxmit LIKE ZGXMIT.

LOOP AT izccod_t.

CALL FUNCTION 'Z_GL_GET_ZGXMIT'

EXPORTING

i_prctr = izccod_t-lg_locnum

I_GJAHR = p_year

I_MONAT = p_period

IMPORTING

E_ZGXMIT = wa_zgxmit

  • EXCEPTIONS

  • NO_ENTRY_FOUND = 1

  • OTHERS = 2

.

  • IF sy-subrc <> 0.

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

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

  • ENDIF.

IF wa_zgxmit-bal_xmit IS INITIAL.

MESSAGE i116(zg) WITH text-040 s_prctr-low text-042 text-045.

LEAVE TO TRANSACTION 'ZGI1352'.

ENDIF.

CLEAR : wa_zgxmit.

ENDLOOP.

endform. " check_prepare_step

FORM get_zgbsis .

SELECT * FROM zgbsis INTO TABLE izgbsis

WHERE prctr IN s_prctr AND

period = p_period AND

ryear = p_year.

IF sy-subrc = 0.

  • Sort izgbsis by Year, Period, Hyperion Location, Statement, Pegstrip

  • (descending).

SORT izgbsis BY ryear period rpt_loc statement pegstrip DESCENDING.

ELSE.

  • Start of commenting - JVALAPA.

  • MESSAGE e100(zg) WITH 'No data in ZGBSIS for that selection.'(e12).

  • End of commenting - JVALAPA.

  • Start of changes - JVALAPA.

data : LV_result(1) type c.

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

TITLEBAR = 'update ZGXMIT'

  • DIAGNOSE_OBJECT = ' '

text_question = 'No data in ZGBSIS even though Prepare has run. Do

you want to update ZGXMIT showing transmission attempt? '

TEXT_BUTTON_1 = 'Yes'(043)

ICON_BUTTON_1 = 'ICON_OKAY'

TEXT_BUTTON_2 = 'No'(044)

ICON_BUTTON_2 = 'ICON_CANCEL'

DEFAULT_BUTTON = '1'

DISPLAY_CANCEL_BUTTON = ' '

  • USERDEFINED_F1_HELP = ' '

START_COLUMN = 25

START_ROW = 6

POPUP_TYPE = 'ICON_MESSAGE_QUESTION'

  • IV_QUICKINFO_BUTTON_1 = ' '

  • IV_QUICKINFO_BUTTON_2 = ' '

IMPORTING

ANSWER = LV_result

  • TABLES

  • PARAMETER =

  • EXCEPTIONS

  • TEXT_NOT_FOUND = 1

  • OTHERS = 2

.

  • IF sy-subrc <> 0.

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

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

  • ENDIF.

CASE LV_result.

when '1'.

PERFORM update_zgxmit.

when '2'.

LEAVE TO TRANSACTION 'ZGI1352'.

clear : LV_result.

ENDCASE.

  • End of chagnes - JVALAPA .

ENDIF.

ENDFORM. " get_zgbsis

0 Kudos

Yeah, you don't have to do that. Simply use the EXIT statement instead. It will issue the information message and return control back to the selection screen where the input values will still be there.

IF wa_zgxmit-bal_xmit IS INITIAL.

MESSAGE i116(zg) WITH text-040 s_prctr-low text-042 text-045.
EXIT.

ENDIF.

Regards,

Rich Heilman

Former Member
0 Kudos

Rich,

if I use EXIT ...it is exiting existing loop and continuueing the next loop.

But not going to the selection screen in this case .

0 Kudos

STOP command terminates the current processing block and triggers END-OF-SELECTION. Can you try using this?

Thanks,

Santosh

0 Kudos

Missed that part. You could set a flag, then EXIT, which will exit the loop, then check the flag after the LOOP, check the flag and EXIT the processing block. Of course, STOP may help too.

Regards,

Rich Heilman

Former Member
0 Kudos

Neither EXIT not STOP is taking me to initial selection which can retain the user entered values .

how can I acheive it ? YOUR HELP IS HIGHLY APPRECIATED.

This is the code :

AT SELECTION-SCREEN.

IF sscrfields-ucomm EQ 'ONLI' OR

sscrfields-ucomm EQ 'PRIN' OR

sscrfields-ucomm EQ 'SJOB'.

IF r_transm = 'X'.

IF r_pegtra = 'X' AND c_uptabl EQ 'X'.

PERFORM check_if_zgbsis_exist.

ENDIF.

ENDIF.

CLEAR currency_errors.

  • Transmission Check: Group Currency Warning

PERFORM check_currency.

  • Delivery Check:

IF r_deliv EQ 'X'.

  • Check file name

PERFORM check_filename.

  • Additional Profit Centers validations:

  • Check izccod-blocked_pc value. List all Profit Centers

  • where the value is 'Z' on a popup indicating that the

  • Profit Centers have already been transmitted.

PERFORM check_blocked_pc.

  • Start of changes - JVALAPA - *****

PERFORM check_prepare_step.

  • End of changes - JVALAPA - *****

IF flag = 'Y'.

<b> EXIT.</b> ENDIF.

  • Select from ZGBSIS where the selected Profit Center, period

  • and year match into internal table izgbsis.

PERFORM get_zgbsis.

IF flag = 'Y'.

<b> EXIT.</b>

ENDIF.

  • Transmission Check:

  • Again do group Currency Check.

PERFORM check_currency_trans.

  • Process ZGBSIS data

PERFORM process_zgbsis.

ENDIF.

ENDIF.

form check_prepare_step .

DATA : wa_zgxmit LIKE ZGXMIT.

CLEAR : flag.

LOOP AT izccod_t.

CALL FUNCTION 'Z_GL_GET_ZGXMIT'

EXPORTING

i_prctr = izccod_t-lg_locnum

I_GJAHR = p_year

I_MONAT = p_period

IMPORTING

E_ZGXMIT = wa_zgxmit

  • EXCEPTIONS

  • NO_ENTRY_FOUND = 1

  • OTHERS = 2

.

  • IF sy-subrc <> 0.

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

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

  • ENDIF.

IF wa_zgxmit-bal_xmit IS INITIAL.

MESSAGE i116(zg) WITH text-040 s_prctr-low text-042 text-045.

  • LEAVE TO TRANSACTION 'ZGI1352'.

  • EXIT.

flag = 'Y'.

ENDIF.

CLEAR : wa_zgxmit.

ENDLOOP.

FORM get_zgbsis .

SELECT * FROM zgbsis INTO TABLE izgbsis

WHERE prctr IN s_prctr AND

period = p_period AND

ryear = p_year.

IF sy-subrc = 0.

  • Sort izgbsis by Year, Period, Hyperion Location, Statement, Pegstrip

  • (descending).

SORT izgbsis BY ryear period rpt_loc statement pegstrip DESCENDING.

ELSE.

  • Start of commenting - JVALAPA.

  • MESSAGE e100(zg) WITH 'No data in ZGBSIS for that selection.'(e12).

  • End of commenting - JVALAPA.

  • Start of changes - JVALAPA.

data : LV_result(1) type c.

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

TITLEBAR = 'update ZGXMIT'

  • DIAGNOSE_OBJECT = ' '

text_question = 'No data in ZGBSIS even though Prepare has run. Do

you want to update ZGXMIT showing transmission attempt? '

TEXT_BUTTON_1 = 'Yes'(043)

ICON_BUTTON_1 = 'ICON_OKAY'

TEXT_BUTTON_2 = 'No'(044)

ICON_BUTTON_2 = 'ICON_CANCEL'

DEFAULT_BUTTON = '1'

DISPLAY_CANCEL_BUTTON = ' '

  • USERDEFINED_F1_HELP = ' '

START_COLUMN = 25

START_ROW = 6

POPUP_TYPE = 'ICON_MESSAGE_QUESTION'

  • IV_QUICKINFO_BUTTON_1 = ' '

  • IV_QUICKINFO_BUTTON_2 = ' '

IMPORTING

ANSWER = LV_result

  • TABLES

  • PARAMETER =

  • EXCEPTIONS

  • TEXT_NOT_FOUND = 1

  • OTHERS = 2

.

  • IF sy-subrc <> 0.

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

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

  • ENDIF.

CASE LV_result.

when '1'.

PERFORM update_zgxmit.

when '2'.

  • LEAVE TO TRANSACTION 'ZGI1352'.

  • EXIT.

flag = 'Y'.

clear : LV_result.

ENDCASE.

  • End of chagnes - JVALAPA .

ENDIF.

ENDFORM. " get_zgbsis

0 Kudos

ONe change..................

IF wa_zgxmit-bal_xmit IS INITIAL. 

MESSAGE i116(zg) WITH text-040 s_prctr-low text-042 text-045. 
* LEAVE TO TRANSACTION 'ZGI1352'. 
flag = 'Y'. 
 EXIT.        "<-  Uncomment this

ENDIF.

Regards,

Rich Heilman

Former Member
0 Kudos

Still my program is not going to selection screen with retained values.

0 Kudos

It actually works really well for me. Not sure what is going on. Are you sure that you are not clear these values somewhere?

Regards,

Rich Heilman.

Former Member
0 Kudos

Hi Sam,

Before calling the Transaction Set the Parameter ID and then call the Transaction.

<b>Set Parameter ID 'xxxx'.

Call transaction 'my tcode'.</b>

Former Member
0 Kudos

Hi,

Try using LEAVE LIST-PROCESSING.

Example

-


TABLES: t001.

PARAMETERS: p_bukrs TYPE bukrs.

START-OF-SELECTION.

SELECT SINGLE * FROM t001

WHERE bukrs = p_bukrs.

IF sy-subrc <> 0.

MESSAGE s208(00) WITH 'Invalid company code'.

LEAVE LIST-PROCESSING.

ENDIF.

Thanks,

Naren

Former Member
0 Kudos

Hi Sam,

If nothing works, I might think in a solution for your problem. Although I guess this should be used in the worst of the cases. What i'm thinking is to create a Z table so before leaving the transaction, you loop through the select-options and save the data to the Z table.

Now that you have the data saved, you can load it at the LOAD-OF-PROGRAM event.

Hope it helps.

Kind Regards,

Gilberto Li