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

write statement - not work

Former Member
0 Likes
2,393

Hi,

I want to write somthing to the screen but when i execute the program nothing happen i'm sure that it's very simple and i missing here someting.

plz advice on this issue...

the code go like that:


AT SELECTION-SCREEN.
  IF sscrfields-ucomm = 'FC01'.
     WRITE / 'test'.


*    PERFORM getdata.
*    PERFORM checklog.
  ENDIF.

12 REPLIES 12
Read only

Former Member
0 Likes
1,515

>


> AT SELECTION-SCREEN.
>   IF sscrfields-ucomm = 'FC01'.
>      WRITE / 'test'.
> 
> *    PERFORM getdata.
> *    PERFORM checklog.
>   ENDIF.
> 

the above code works and Write TEST to the output screen only when you click on a Button which is having the Function code FC01

Read only

0 Likes
1,515

i've click on this button and nothing happen i've check on the debug. it come to this line do it but no output to the screen.

any idea??

Read only

0 Likes
1,515

Show me your code..

it is not possible to write at the event.

Read only

0 Likes
1,515

in the AT SELECTION-SCREEN i have to write some text to the screen how can i do that (create new screen and write there???)

Read only

0 Likes
1,515

instead of thata you can give the Message(information or success).

if you are referring to demo program then just modify the at selection-screen part.

REPORT demo_sel_screen_function_key.

TABLES sscrfields.
data: ucomm type sy-ucomm.

PARAMETERS: p_carrid TYPE s_carr_id,
            p_cityfr TYPE s_from_cit.

SELECTION-SCREEN: FUNCTION KEY 1,
                  FUNCTION KEY 2.

INITIALIZATION.
  sscrfields-functxt_01 = 'LH'.
  sscrfields-functxt_02 = 'UA'.

AT SELECTION-SCREEN.
  CASE sscrfields-ucomm.
      WHEN'FC01'.
       message sscrfields-ucomm type 'I'.
    WHEN 'FC02'.
       ucomm = ucomm = sscrfields-ucomm.
  ENDCASE.

START-OF-SELECTION.
  WRITE ucomm.

Read only

0 Likes
1,515

I want that the FC01 button will act like F8 so it'll able to write to the screen.

Read only

0 Likes
1,515

In that case you can go with this option..

REPORT zdemo_sel_screen_function_key.

TABLES sscrfields.
data: ucomm type sy-ucomm.

PARAMETERS: p_carrid TYPE s_carr_id,
            p_cityfr TYPE s_from_cit,
            p_funct  type sy-ucomm no-display.

SELECTION-SCREEN: FUNCTION KEY 1,
                  FUNCTION KEY 2.

INITIALIZATION.
  sscrfields-functxt_01 = 'LH'.
  sscrfields-functxt_02 = 'UA'.

AT SELECTION-SCREEN.
  CASE sscrfields-ucomm.
      WHEN'FC01'.
       submit (sy-repid) with p_funct = sscrfields-ucomm
        and return.
    WHEN 'FC02'.
       ucomm = ucomm = sscrfields-ucomm.
  ENDCASE.

START-OF-SELECTION.
  WRITE p_funct.

Regards

Vijay Babu Dudla

Read only

Former Member
0 Likes
1,515

Hi,

Try to use this code:

AT SELECTION-SCREEN.

CASE sscrfields-ucomm.

WHEN'FC01'.

WRITE / 'test'.

ENDCASE.

Hope this will help u.

for more detail check out link in ABAPDOCU of your SAP SYSTEM.

ABAP Documentation and Examples >BC - ABAP Programming > ABAP User Dialogs > Selection Screens > Possible user actions > Pushbuttons in Application Toolbiste .

Read only

Former Member
0 Likes
1,515

Hi

You can use the COMMENT statement to display some text on the selection screen. And let the COMMENT has a MODIF ID, and you can enable/disable in the event AT SELECTION SCREEN OUTPUT.



SELECTION-SCREEN: 
                  COMMENT /1(79) text-s02 MODIF ID com,
                  COMMENT /1(79) text-s03 MODIF ID com,
                  COMMENT /1(79) text-s04 MODIF ID com.

--
 
--

--

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    IF sscrfields-ucomm = 'FC01' AND screen-group1 = 'COM'.
        screen-active = 1.
     ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

 

Thanks

-Pavan

Read only

Former Member
0 Likes
1,515

You'll have to check the status of your screen to see if the F1 key is already associated with another code or if it responds to FC01.

In case it responds to FC01, you can simplify things with

AT SELECTION SCREEN.
   IF sy-ucomm = 'FC01'.
       WRITE / 'test'.
*       PERFORM getdata.
*       PERFORM checklog.
   ENDIF.

Read only

0 Likes
1,515

sscrfields-ucomm ... can u declare the string as 'sscrfields-ucomm' and see if u get lucky.

Read only

Former Member
0 Likes
1,515

Hi,

i believe this should help you.

AT SELECTION-SCREEN.

  IF sscrfields-ucomm = 'FC01'.

     WRITE / 'test'.

     LEAVE TO LIST-PROCESSING.

*    PERFORM getdata.

*    PERFORM checklog.

  ENDIF.