Screen button

Today I learned a small function and created an on-screen button. I remember I learned it before, but I quickly forgot and I was disappointed with my memory
Hey, let's share more for the dumb bird, come on, sweet grapefruit
About adding screen buttons
Three:

1
types-pools icon.
tables sscrfields .
data functxt type smp_dyntxt. "If you don’t want pictures, you don’t need this

2
selection-screen: function key 1.
function key 2.
3
initialization.
sscrfields-functxt_01 ='Template download'. "Button without picture
functxt-icon_id = icon_ws_plane.
functxt-icon_text ='Aircraft template download'. Button for picture
sscrfields-functxt_02 = functxt.

at selection-screen.
case sscrfields-ucomm.
when 'FC01'
WHEN 'FC02'



The detailed code is as follows
TYPE-POOLS icon.
TABLES sscrfields.
DATA functxt TYPE smp_dyntxt.

PARAMETERS: p_carrid TYPE s_carr_id,
            p_cityfr TYPE s_from_cit.
SELECTION-SCREEN: FUNCTION KEY 1,
                 FUNCTION KEY 2.

INITIALIZATION.
  functxt-icon_id   = icon_ws_plane.
  functxt-icon_text = '飞机模板下载'.
  sscrfields-functxt_01 = functxt.
  "functxt-icon_text = 'UA'.
  sscrfields-functxt_02 = '模板下载'.

AT SELECTION-SCREEN.
  CASE sscrfields-ucomm.
    WHEN 'FC01'.
      p_carrid = 'LH'.
      p_cityfr = 'Frankfurt'.
    WHEN 'FC02'.
      p_carrid = 'UA'.
      p_cityfr = 'Chicago'.
    WHEN OTHERS.
      ...
  ENDCASE.

Guess you like

Origin blog.csdn.net/weixin_41839503/article/details/80499857
Recommended