Monday, March 3, 2014

How to create cockpit


REPORT ZCOCKPIT no standard page heading.
tables : sscrfields.

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

selection-screen skip 1.
selection-screen begin of line.
selection-screen : position 10, pushbutton (30) p_but1 user-command but1,
                   pushbutton (30) p_but2 user-command but2,
                   pushbutton (30) p_but3 user-command but3.

selection-screen end of line.

selection-screen begin of line.
selection-screen : position 10, pushbutton (30) p_but4 user-command but4,
                   pushbutton (30) p_but5 user-command but5,
                   pushbutton (30) p_but6 user-command but6.
selection-screen end of line.

selection-screen : end of block block1.


initialization.

  p_but1  = 'CREATE SALES ORDER'.
  p_but2  = 'CREATE OBD ORDER'.
  p_but3  = 'CREATE GR'.
  p_but4  = 'CREATE PGI ORDER'.
  p_but5  = 'CREATE SHIPMENT ORDER'.
  p_but6  = 'MISC'.

at selection-screen.
  case sscrfields-ucomm.
    when 'BUT1'.
      leave to transaction 'VA01'.
    when 'BUT2'.
      leave to transaction 'VL01N'.
    when 'BUT3'.
      leave to transaction 'MIGO'.
    when 'BUT4'.
      leave to transaction 'VL02N'.
    when 'BUT5'.
      leave to transaction 'VT01N'.
    when 'BUT6'.
      leave to transaction 'VT02N'.
  endcase.



Output:



Drop Down lists in the selection parameters

PROGRAM ztest.   TYPE-POOLS : vrm.   DATA : name TYPE vrm_id,        list TYPE vrm_values,        value LIKE LINE OF list. ...