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: 

Multiple ALV Grid Controls per report - problem with default displ.variant

Former Member
0 Kudos

Hi,

I have a report with few screens called sequentialy. Each one of the screens has implemented own instance of ALV Grid Control within custom container, means:

- screen 100 has container Cont100 and grid control "grid100",

- screen 110 has container Cont110 and grid control "grid110"

- screen 120 has container Cont120 and grid control "grid120"

and so on...

Each one of the grid controls is initialized with own field catalog table, with own layout and variant structure definitions. My problem occurs when the user changes the display variant for some of the grid controls and save the layout variant using "default setting" checkbox. In this case next time the program is started all other grid controls behaves like they don't have their own variant definitions, but uses the default setting of the mentioned screen. This leads (usualy) to unsuable grid controls by default, because usualy different controls have no equal field-definition tables. I have the same behaviour even when there are more than 1 ALV grids on a single screen (for example - 2).

For now I don't provide variant variables at selection screen, but it seems there is no way to provide such variables for each one of the grid-controls.

Is anyone aware how to control this? Means no matter if there is default setting in use for some of the grid-controls, how to manipulate other grid-controls not to use this default setting?

Many thanks in advance.

Regards,

Ivaylo Mutafchiev

1 ACCEPTED SOLUTION

Former Member
0 Kudos

When working with multiple ALV grids on the same screen or in the same program, you need to use the Handle feature to clearly define which variants/layouts go with each grid. I have gotten in the habit of always using this feature even if I only have one grid.


* Support ALV Layouts.

  gwa_variant    TYPE disvariant,

. . .


*   Set handle so that any ALV layouts created by the user will only
*    apply to the table they are created for.  

    gwa_variant-handle = ‘A100’.

. . .

*   Display via ALV.

    CALL METHOD gr_alv->set_table_for_first_display
        EXPORTING is_variant       = gwa_variant
                  is_layout        = gwa_layout
                  i_save           = 'A'
        CHANGING  it_outtab        = cpt_stat
                  it_fieldcatalog  = gt_fieldcat.

14 REPLIES 14

Former Member
0 Kudos

I have an ALV report which uses four containers each with it's own default variant. It works perfectly. Each variant name must be unique. Let me know if you would like for me to post or send you the report.

Regards,

Fred Morsell

0 Kudos

Hi,

I've just tried to set 'default setting' for variants, used in different grids. What I found is that there is possibility to set 'default setting' checkbox for 1 of the variants only, and the variants for all grid-controls within the report are listed within the same 1 list. How then I can set 'default setting' checkbox for more than 1 variant?

Or should I define variants before sending the program to production system and hardcode within the code which grid to which variant to be connected?

I'm confused, if this would be the case....

Yes, please, I would be glad to check your report. Use the e-mail provided in my business card.

Thanks,

Ivaylo

0 Kudos

Fred,

thank you for the code. Unfortunately, it doesn't become clear for me how the "default" variant values for different grids are handled. I saw what you did in your code - it's very clear and well covered - and modified my code to do similar, so far without success The behaviour of my report changed from its 'original' before my tests with your approach. Obviously, I modified somehow my framework, playing with other proposition from the forum (setting handles for each layout), and that modified the behaviour of the SAVE function for variants - now I'm not able to check the box 'Default setting' for all the grids except the first (main) one. This check-box becomes grayed. Which doesn't allow the user to use default setting for 'nested' grids, but for a main one only. There is still possibility to preset the 'Default variant' value - via menu 'Manage variants' => checking the 'Default setting' is allowed for 1 of all the variants defined per report. And this possibility (means column 'Default setting') is available when calling 'Manage variants' from the main ALV-grind. Note: The meaning of 'MAIN ALV grid' here is for the 1st one called in the flow logic of the program.

I checked another one of my reports, where multiple alv-grid usage is implemented and there the possibility for managing 'Default variant' check-box is available for all the grids - no matter first one or any onther subsequent...

I saw in the 'INITIALIZATION' section of your code you have changed the values for variables

p_itemv

p_bomv

p_notev

p_pricv

which are used in different containers. It's not clear for me how the function module 'REUSE_ALV_VARIANT_DEFAULT_GET' (it is the same as FM 'LVC_VARIANT_DEFAULT_GET', as far as I investigated) distinguishes to get the default variant for every particular grid - it allways returns only 1 variant name - because it possible to set as "default" only 1 variant in the tables of grid-variants for the report.

After all the investigations it seems to me I need fully documented reference for the structure 'DISVARIANT' - what different fields means and what their changes means to the related grid.

Thanks again,

Ivaylo

former_member194669
Active Contributor
0 Kudos

Hi,

I have done the same in some time by restricting the users to change the global variant rights using


form f_check_layout_auth.
  authority-check object 'S_ALV_LAYO'
           id 'ACTVT' field '23'.
  if sy-subrc eq 0.
    v_save              = 'A'.
    v_default           = c_x.
  else.
    v_save              = 'U'.
    v_default           = space.
  endif.
endform.                                 " F_check_layout_auth

    call method grid1->set_table_for_first_display
      exporting
        is_layout                     = gs_layout
        is_variant                    = gs_variant
        i_save                        = v_save      " << Check this
        i_default                     = v_default   " << Check this
        it_toolbar_excluding          = i_exclude[]
      changing
        it_outtab                     = i_output[]
        it_fieldcatalog               = i_fieldcat[]
      exceptions
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        others                        = 4.

May this one will help you

aRs

0 Kudos

Hi,

I think I miss the point in your code when you called the form 'f_check_layout_auth'. Could you provide the code where you have called it also?

Thanks,

Ivaylo.

former_member194669
Active Contributor
0 Kudos

Hi,

I think you need better to get the variants name in the selection screen for all grid.

using


  call function 'LVC_VARIANT_DEFAULT_GET'
    exporting
      i_save        = v_variant_save
    changing
      cs_variant    = gs_variantt
    exceptions
      wrong_input   = 1
      not_found     = 2
      program_error = 3
      others        = 4.

aRs

0 Kudos

Well,

This would return all the variants defined for the report, but not for a single grid-control....

Well, guys, I'm sorry to say, but I'll proceed futher with checks here in monday. Now I have to leave the office now for today.

Thanks to all of you who colaborated

Ivaylo

Former Member
0 Kudos

When working with multiple ALV grids on the same screen or in the same program, you need to use the Handle feature to clearly define which variants/layouts go with each grid. I have gotten in the habit of always using this feature even if I only have one grid.


* Support ALV Layouts.

  gwa_variant    TYPE disvariant,

. . .


*   Set handle so that any ALV layouts created by the user will only
*    apply to the table they are created for.  

    gwa_variant-handle = ‘A100’.

. . .

*   Display via ALV.

    CALL METHOD gr_alv->set_table_for_first_display
        EXPORTING is_variant       = gwa_variant
                  is_layout        = gwa_layout
                  i_save           = 'A'
        CHANGING  it_outtab        = cpt_stat
                  it_fieldcatalog  = gt_fieldcat.

0 Kudos

Charles,

thanks very much, that almost did the trick. I checked it and it works. The only disatvantage with this apporach is that in this case I have no possibility to check "default variant" for each one of the grids, but for a .... main one?... only. "Main" means first one called within the program. I'm not quite sure how it is organized and why I have possibility to set "Default" for some of the variants of the first alv-grid called, but can't do that for any other sequentially called. Is there a way to handle this also - to be able to use "default" for every one of the grids?

Thanks again.

Ivaylo

0 Kudos

Hi Ivaylo Mutafchiev,

if you set a unique layout handle, you can have default layout for each of them. In one of my programs I created a form to get unique handles based to the structure of the table displayed. First I got all fieldnames in my display table, then put it into a hash function and used the result for variant log_group and handle. OK I have to admit: Because the hash value is more than 8 characters, it might confuse layouts with a chance of 1 in a million. Luckily it never did.


*&---------------------------------------------------------------------*
*&      Form  ALV_UNIQUE_HANDLE
*&---------------------------------------------------------------------*
*       For all secondary grids/lists, set a unique handle
*----------------------------------------------------------------------*
FORM alv_unique_handle
  USING    pr_tabref                      TYPE REF TO data
  CHANGING ps_variant                     TYPE disvariant.
  DATA:
    lv_hash                               TYPE rsmds_hashx,
    lt_field                              TYPE fieldname_tab.
  STATICS:
    lr_tabref_basic_list                  TYPE REF TO data.
  FIELD-SYMBOLS:
    <itab>                                TYPE STANDARD TABLE.
  IF lr_tabref_basic_list IS INITIAL.
* for distinction of list as for retrieval of 'old' layout: remember basic reference
    lr_tabref_basic_list                  = pr_tabref.
  ENDIF.
  CHECK lr_tabref_basic_list              <> pr_tabref.
* get the field list (that should be unique  - one layout for one fieldlist!)
  ASSIGN pr_tabref->* TO <itab>.
  PERFORM getfields USING <itab> CHANGING lt_field.
* for secondary lists set layout variant HANDLE and log_group

  TRY.
      CALL METHOD cl_rsmds_hash_utilities=>to_hash_x20
        EXPORTING
          i_data     = lt_field
        RECEIVING
          r_hash_x20 = lv_hash.
    CATCH cx_rsmds_input_invalid_type.
      EXIT.
    CATCH cx_rsmds_input_invalid .
      EXIT.
  ENDTRY.
* not 100 % clean: len(lv_hash) > len(log_group) + len(handle).
  ps_variant-log_group                       = lv_hash(4).
  ps_variant-handle                          = lv_hash+4(4).
ENDFORM.                    " ALV_UNIQUE_HANDLE
*&---------------------------------------------------------------------*
*&      Form  getfields
*&---------------------------------------------------------------------*
*       get fieldnames for table or structure
*----------------------------------------------------------------------*
FORM getfields
  USING    px_data                        TYPE any
  CHANGING pt_fields                      TYPE table.
  DATA:
    lt_comp                               TYPE abap_compdescr_tab,
    lr_dat                                TYPE REF TO data,
    lr_typedescr                          TYPE REF TO cl_abap_typedescr,
    lr_structdescr                        TYPE REF TO cl_abap_structdescr.
  FIELD-SYMBOLS:
    <fs>                                  TYPE ANY,
    <ft>                                  TYPE ANY TABLE,
    <comp>                                TYPE LINE OF abap_compdescr_tab.
  lr_typedescr                            = cl_abap_typedescr=>describe_by_data( px_data ).
  CASE lr_typedescr->type_kind.
    WHEN 'S'.
      lr_structdescr ?= lr_typedescr.
      lt_comp                             = lr_structdescr->components.
    WHEN 'T' OR 'h'.
      ASSIGN px_data TO <ft>.
      CREATE DATA lr_dat                  LIKE LINE OF <ft>.
      ASSIGN lr_dat->* TO <fs>.
      lr_structdescr ?= cl_abap_structdescr=>describe_by_data( <fs> ).
      lt_comp                             = lr_structdescr->components.
    WHEN OTHERS.
      MESSAGE e241(00).
*   Function is invalid                   in this environment
  ENDCASE.
  CLEAR pt_fields.
  LOOP AT lt_comp ASSIGNING <comp>.
    APPEND <comp>-name TO pt_fields.
  ENDLOOP." at lt_comp assigning <comp>.
ENDFORM.                    " getfields

Regards,

Clemens

0 Kudos

Clemens,

thank you for the reply. My enviromnent is 4.6D and some pieces of your sample wouldn't work here, so it will took some time for me to manage your sample to my needs and to find out if it works for me. Based on the investigations from the other participants' answers in the thread It seems this is the case, but unless I checked it I can't be 100% sure.

I'll share my results here as soon as I get some.

Thanks again.

Ivaylo

0 Kudos

check this sample code which displays 4 grids in 4 different tabs and with 4 different handles

PROGRAM sapmzsdpp MESSAGE-ID z1.

----


  • Table Declarations *

----


TABLES:

vbpa, " Sales Document: Partner

kna1, " Customer Master

vbap. " Sales Document: Item Data

----


  • Tab Strip Declarations *

----


CONTROLS:

tabstrip_sdpp TYPE TABSTRIP. " Tabstrip

----


  • Constants declarations *

----


CONSTANTS:

c_rep_zm(2) TYPE c VALUE 'ZM', " Outside Sales Representative

c_rep_ve(2) TYPE c VALUE 'VE', " Inside Sales Representative

c_rep_zi(2) TYPE c VALUE 'ZI', " Sales Manager

c_abgru_08(2) TYPE c VALUE '08', " Reason for Rej: SO Not Closed

c_stock_ind_e TYPE c VALUE 'E', " Stock Idctr : Orders on hand

c_gauge(5) TYPE c VALUE 'GAUGE', " Characteristic Name - GAUGE

c_width(5) TYPE c VALUE 'WIDTH', " Characteristic Name - WIDTH

c_gauge_metric(12) " Character Name - GAUGE_METRIC

TYPE c VALUE 'GAUGE_METRIC',

c_width_metric(12) " Character Name - WIDTH_METRIC

TYPE c VALUE 'WIDTH_METRIC',

c_eng_metric(14) " Charac Value - ENGLISH_METRIC

TYPE c VALUE 'ENGLISH_METRIC',

c_coil(4) TYPE c VALUE 'COIL', " For Value COIL

c_spec_bf(7) TYPE c VALUE 'SPEC_BF'," Charac value SPEC_BF

c_wadat_ist(8) " Actual Goods Movement Date

TYPE c VALUE '00000000',

c_mcha(4) TYPE c VALUE 'MCHA', " Database Table 'MCHA'

c_classtype_022(3)

TYPE c VALUE '022', " Class Type : BATCH

c_pipe(2) TYPE c VALUE '06', " Material Pricing Group: Pipes

c_item_ctgry_ztam(4)

TYPE c VALUE 'ZTAM', " Item Cat:Certificate Mnfctr

c_lab_result(10) " Charac Value LAB_RESULT

TYPE n VALUE '0000001392',

c_none_reqd(10) " For Value NONE REQD

TYPE c VALUE 'NONE REQD.',

c_passed(6) TYPE c VALUE 'PASSED', " For Value PASSED

c_pending(12) TYPE c " For Value TEST PENDING

VALUE 'TEST PENDING',

c_bundling(13) " For Value TEST BUNDLING

TYPE c VALUE 'TEST BUNDLING',

c_normal(2) TYPE c VALUE '01'. " Priority: Normal

----


  • Internal Table Declarations *

----


DATA :

  • Internal table to hold common data for all reports

BEGIN OF t_common_data OCCURS 0,

kunnr LIKE vbak-kunnr, " Customer Number

vbeln LIKE vbap-vbeln, " Sales Document Number

posnr LIKE vbap-posnr, " Sales Document Item Number

ihrez_e LIKE vbkd-ihrez_e, " Mill Order Number

matnr LIKE vbap-matnr, " Material Number

pstyv LIKE vbap-pstyv, " Sales Document Item Category

kwmeng LIKE vbap-kwmeng, " Cumulative Order Quantity

lprio LIKE vbap-lprio, " Delivery Priority

werks LIKE vbap-werks, " Plant

kondm LIKE vbap-kondm, " Material Pricing Group

aedat LIKE vbap-aedat, " Date of Last Change

cuobj LIKE vbap-cuobj, " Configuration

saldata LIKE vbap-zzcust_req_avail,

" Required Availability Date

END OF t_common_data,

  • Internal table to hold Customer Number

BEGIN OF t_cust_temp OCCURS 0,

kunnr LIKE vbak-kunnr, " Customer Number

END OF t_cust_temp,

  • Internal table to hold stock details

BEGIN OF t_stock OCCURS 0,

vbeln LIKE mska-vbeln, " Sales Document Number

posnr LIKE mska-posnr, " Sales Document Item Number

matnr LIKE mska-matnr, " Material Number

werks LIKE mska-werks, " Plant

charg LIKE mska-charg, " Batch Number

kalab LIKE mska-kalab, " Valuated Stock

ersda LIKE mska-ersda,

END OF t_stock,

  • Internal table to hold deliveries

BEGIN OF t_delivery_data OCCURS 0,

vbeln LIKE lips-vbeln, " Delivery Document Number

vgbel LIKE lips-vgbel, " Document No of Ref Document

vgpos LIKE lips-vgpos, " Item No of Ref Item

END OF t_delivery_data,

  • Internal table to hold released tons & released days

BEGIN OF t_released_tons_days OCCURS 0,

vbeln LIKE likp-vbeln, " Delivery Document Number

btgew LIKE likp-btgew, " Total Weight

bldat LIKE likp-bldat, " Document Date in Document

END OF t_released_tons_days,

  • Internal table to hold Pre-Production-Pending Orders (Report-1)

BEGIN OF t_pre_prod_ord OCCURS 0,

sortl1 LIKE zcustcode-sortl, " Customer Search Term

ihrez_e1 LIKE vbkd-ihrez_e, " Mill Order Number

salord1(17) TYPE c, " Sales Order Document & Item

descri TYPE char70, " Specification of the Item

speci TYPE char30, " Description of the Item

days_entry LIKE zlgcyinfo-days_since_entry,

" Days Since Entry

dept LIKE zlgcyinfo-bklog, " Department

notes1 LIKE zcsimemo-text, " CSI File Memo Text

*/ Request No. DV2K904687

chng_date LIKE vbap-aedat, " Date of Last Change

END OF t_pre_prod_ord,

  • Internal table to hold Delinquent Orders (Report-2)

BEGIN OF t_delinquent_ord OCCURS 0,

sortl2 LIKE zcustcode-sortl, " Customer Search Term

ihrez_e2 LIKE vbkd-ihrez_e, " Mill Order Number

salord2(17) TYPE c, " Sales Order Document & Item

descri TYPE char70, " Specification of the Item

speci TYPE char30, " Description of the Item

saldata LIKE vbap-zzcust_req_avail,

schdate LIKE vbep-edatu, " Schedule Line Date

days_late LIKE zlgcyinfo-dayslate,

" Days Late

unit LIKE zlgcyinfo-unit, " Status of Consolidation Units

days_at_unit LIKE zlgcyinfo-daysatunit,

notes2 LIKE zcsimemo-text, " CSI File Memo Text

END OF t_delinquent_ord,

  • Internal table to hold Processed Material Orders (Report-3)

BEGIN OF t_processed_ord OCCURS 0,

sortl3 LIKE zcustcode-sortl, " Customer Search Term

ihrez_e3 LIKE vbkd-ihrez_e, " Mill Order Number

salord3(17) TYPE c, " Sales Order Document & Item

descri TYPE char70, " Specification of the Item

speci TYPE char30, " Description of the Item

order_tons LIKE vbap-kwmeng, " Cumulative Order Quantity

fin_tons LIKE mska-kalab, " Val.Stock With Unres Usage

fin_days TYPE i, " Finished Days

rel_tons LIKE likp-btgew, " Total Weight

rel_days TYPE i, " No.of.Days Order is Released

status(15) TYPE c, " Status Of Stock

tb_tons LIKE zlgcyinfo-tons, " Tons

notes3 LIKE zcsimemo-text, " CSI File Memo Text

END OF t_processed_ord,

  • Internal table to hold Flagged Orders (Report-4)

BEGIN OF t_flagged_ord OCCURS 0,

sortl4 LIKE zcustcode-sortl, " Customer Search Term

ihrez_e4 LIKE vbkd-ihrez_e, " Mill Order Number

salord4(17) TYPE c, " Sales Order Document & Item

descri TYPE char70, " Specification of the Item

speci TYPE char30, " Description of the Item

saldata LIKE vbap-zzcust_req_avail,

unit LIKE zlgcyinfo-unit, " Status of Consolidation Units

tons LIKE zlgcyinfo-tons, " Tons

priority LIKE vbap-lprio, " Delivery Priority

notes4 LIKE zcsimemo-text, " CSI File Memo Text

END OF t_flagged_ord,

  • Internal table to hold CSI memo file data

BEGIN OF t_csi_memo_data OCCURS 0,

vbeln LIKE zcsimemo-vbeln, " Sales Document Number

posnr LIKE zcsimemo-posnr, " Sales Order line item

text LIKE zcsimemo-text, " CSI File Memo Text

END OF t_csi_memo_data,

  • Internal table to hold Customer Codes

BEGIN OF t_customer_code OCCURS 0,

sortl LIKE zcustcode-sortl, " Sort Field

kunnr LIKE zcustcode-kunnr, " Customer Number

END OF t_customer_code,

  • Internal table to hold schedule line dates

BEGIN OF t_schedule_line_date OCCURS 0,

vbeln LIKE vbep-vbeln, " Sales Document Number

posnr LIKE vbep-posnr, " Sales Document Item Number

edatu LIKE vbep-edatu, " Schedule line date

END OF t_schedule_line_date,

  • Internal table to hold Characteristic values

t_configuration

TYPE TABLE OF conf_out

WITH HEADER LINE,

  • Internal tables to hold legacy data

t_lgcyinfo TYPE TABLE OF zlgcyinfo

WITH HEADER LINE.

----


  • Work variables declarations *

----


DATA:

gv_parvw LIKE kupav-parvw, " Partner function

gv_abgru LIKE vbap-abgru, " Reason to eject sales order

gv_gauge LIKE conf_out-atwtb, " Charac Value Description

gv_width LIKE conf_out-atwtb, " Charac Value Description

gv_ok_code LIKE sy-ucomm, " Usercommand

gv_okcode LIKE sy-ucomm, " User Command

gv_number LIKE sy-dynnr

VALUE '0101', " Initial Sub Screen Number

gv_vbeln LIKE vbak-vbeln, " Sales Order

gv_posnr LIKE vbup-posnr, " Sales Item

*/ Request No. DV2K904687

gv_del_prio LIKE vbap-lprio, " Delivery Priority

gv_obj_key LIKE inob-objek, " Object Key

gv_config LIKE inob-cuobj, " Configuration

gv_lab_result LIKE ausp-atwrt, " Lab Result Value

gv_pass_stock LIKE mska-kalab, " Finished Stock

gv_fail_stock LIKE mska-kalab, " Failed Stock

gv_tp_tons LIKE mska-kalab, " Test Pending Tons

gv_csi_stock LIKE mbew-lbkum, " CSI Stock On Hand

gv_val_stock LIKE mska-kalab, " Valuated Stock

gv_fin_tons LIKE mska-kalab, " Finished Tons

gv_fin_days TYPE i, " Finished Days

gv_rel_tons LIKE likp-btgew, " Released Tons

gv_rel_days TYPE i, " Released Days

gv_no_delivery " Number of Delivery Documents

TYPE i,

gv_bund_tons LIKE zlgcyinfo-tons, " Bundling Tons

gv_net_weight LIKE mara-ntgew, " Net Weight

gv_tb_tons LIKE zlgcyinfo-tons, " Test/Bundling Tons

gv_date LIKE mska-ersda, " Date

gv_tabix LIKE sy-tabix, " Table Index

gv_flg TYPE c, " Flag Variable

gv_exit TYPE c. " For Parameter Exit

----


  • Constant declarations for ALV Grid *

----


CONSTANTS:

c_cont_pre_prod_ord

TYPE scrfname VALUE 'CUST_PPP',

" Custom Container for Report-1

c_cont_delinquent_ord

TYPE scrfname VALUE 'CUST_DIP',

" Custom Container for Report-2

c_cont_processed_ord

TYPE scrfname VALUE 'CUST_PMS',

" Custom Container for Report-3

c_cont_flagged_ord

TYPE scrfname VALUE 'CUST_FLGORD',

" Custom Container for Report-4

c_handle1(3) TYPE c VALUE 'G_1', " Handle for PPP rpt Grid

c_handle2(3) TYPE c VALUE 'G_2', " Handle for DIP rpt Grid

c_handle3(3) TYPE c VALUE 'G_3', " Handle for PMS rpt Grid

c_handle4(3) TYPE c VALUE 'G_4', " Handle for FLGORD rpt Grid

c_true TYPE c VALUE 'X', " For value 'X'

c_save TYPE c VALUE 'A'. " User-Defd & Global Variants

----


  • Selection Screen *

----


SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-014.

PARAMETERS :

p_osr RADIOBUTTON GROUP g1

DEFAULT 'X', " Outside Sales Representative

p_isr RADIOBUTTON GROUP g1, " Inside Sales Representative

p_s_mgr RADIOBUTTON GROUP g1. " Sales Manager

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-005.

SELECT-OPTIONS:

s_pernr FOR vbpa-pernr

OBLIGATORY, " Employee Number

s_kunnr FOR kna1-kunnr, " Customer Number

s_sortl FOR kna1-sortl, " Customer Search Term

s_kondm FOR vbap-kondm. " Material Pricing Group

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-006.

PARAMETERS:

p_open RADIOBUTTON GROUP g2

DEFAULT 'X', " Open Orders

p_closed RADIOBUTTON GROUP g2. " Closed Orders

SELECTION-SCREEN END OF BLOCK b3.

SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-007.

PARAMETERS:

p_var1 LIKE disvariant-variant, " Variant For Report-1

p_var2 LIKE disvariant-variant, " Variant For Report-2

p_var3 LIKE disvariant-variant, " Variant For Report-3

p_var4 LIKE disvariant-variant. " Varinat For Report-3

SELECTION-SCREEN END OF BLOCK b4.

SELECTION-SCREEN END OF SCREEN 500.

*/ Begin of Modification - Request No. DV2K904687

  • Selection Screen for Changing Sales Order Priority

SELECTION-SCREEN BEGIN OF SCREEN 1100 AS WINDOW.

SELECTION-SCREEN BEGIN OF BLOCK b5 WITH FRAME TITLE text-044.

PARAMETERS p_sonum LIKE vbap-vbeln." Sales Order Number

SELECT-OPTIONS s_item FOR vbap-posnr." Sales Order Item

PARAMETERS p_delpr LIKE vbap-lprio." Delivery Priority

SELECTION-SCREEN END OF BLOCK b5.

SELECTION-SCREEN END OF SCREEN 1100.

*/ End of Modification - Request No. DV2K904687

----


  • CLASS lcl_gv_event_receiveriver DEFINITION *

----


CLASS lcl_event_receiver DEFINITION DEFERRED.

----


  • ALV Grid - Work Variables Declarations *

----


DATA:

gv_cont_pre_prod_ord TYPE REF

TO cl_gui_custom_container,

" Custom Cont For Report-1

gv_cont_delinquent_ord TYPE REF

TO cl_gui_custom_container,

" Custom Cont For Report-2

gv_cont_processed_ord TYPE REF

TO cl_gui_custom_container,

" Custom Cont For Report-3

gv_cont_flagged_ord TYPE REF

TO cl_gui_custom_container,

" Custom Cont For Report-4

gv_grid_pre_prod_ord TYPE REF

TO cl_gui_alv_grid,

" Grid For Report-1

gv_grid_delinquent_ord TYPE REF

TO cl_gui_alv_grid,

" Grid For Report-2

gv_grid_processed_ord TYPE REF

TO cl_gui_alv_grid,

" Grid For Report-3

gv_grid_flagged_ord TYPE REF

TO cl_gui_alv_grid,

" Grid For Report-4

gv_event_receiver TYPE REF

TO lcl_event_receiver,

" Object For Local Class

gs_lay_pre_prod_ord TYPE lvc_s_layo,

" Work Area for Grid layout

gs_lay_delinquent_ord TYPE lvc_s_layo,

" Work Area for Grid layout

gs_lay_processed_ord TYPE lvc_s_layo,

" Work Area for Grid layout

gs_lay_flagged_ord TYPE lvc_s_layo,

" Work Area for Grid Layout

gs_var_pre_prod_ord TYPE disvariant,

" Layout Structure

gs_var_delinquent_ord TYPE disvariant,

" Layout Structure

gs_var_processed_ord TYPE disvariant,

" Layout Structure

gs_var_flagged_ord TYPE disvariant,

" Layout Structure

t_fcat_pre_prod_ord TYPE lvc_t_fcat

WITH HEADER LINE,

" Field Catalog For Report-1

t_fcat_delinquent_ord TYPE lvc_t_fcat

WITH HEADER LINE,

" Field Catalog For Report-2

t_fcat_processed_ord TYPE lvc_t_fcat

WITH HEADER LINE,

" Field Catalog For Report-3

t_fcat_flagged_ord TYPE lvc_t_fcat

WITH HEADER LINE,

" Field Catalog For Report-4

t_exclude TYPE ui_functions,

" Function Code Table

gs_exclude TYPE ui_func. " Function Code Structure

----


  • CLASS lcl_gv_event_receiver DEFINITION *

----


CLASS lcl_event_receiver DEFINITION.

PUBLIC SECTION.

METHODS:

handle_hotspot

FOR EVENT hotspot_click OF cl_gui_alv_grid

IMPORTING e_row_id e_column_id es_row_no,

handle_top_of_page

FOR EVENT print_top_of_page OF cl_gui_alv_grid,

*/ Begin of Modification - Request No. DV2K904687

handle_toolbar

FOR EVENT toolbar OF cl_gui_alv_grid

IMPORTING e_object e_interactive,

handle_user_command

FOR EVENT user_command OF cl_gui_alv_grid

IMPORTING e_ucomm.

*/ End of Modification - Request No. DV2K904687

ENDCLASS. " LCL_EVENT_RECEIVER DEFINITION

----


  • CLASS IMPLEMENTATION *

----


CLASS lcl_event_receiver IMPLEMENTATION.

METHOD handle_hotspot.

CASE e_column_id-fieldname.

WHEN 'SALORD1'.

CLEAR t_pre_prod_ord.

READ TABLE t_pre_prod_ord

INTO t_pre_prod_ord

INDEX e_row_id-index.

  • Call VA03 To View Sales Order Line Item Details

PERFORM call_va03 USING t_pre_prod_ord-salord1.

WHEN 'SALORD2'.

CLEAR t_delinquent_ord.

READ TABLE t_delinquent_ord

INTO t_delinquent_ord

INDEX e_row_id-index.

  • Call VA03 To View Sales Order Line Item Details

PERFORM call_va03 USING t_delinquent_ord-salord2.

WHEN 'SALORD3'.

CLEAR t_processed_ord.

READ TABLE t_processed_ord

INTO t_processed_ord

INDEX e_row_id-index.

  • Call VA03 To View Sales Order Line Item Details

PERFORM call_va03 USING t_processed_ord-salord3.

WHEN 'SALORD4'.

CLEAR t_flagged_ord.

READ TABLE t_flagged_ord

INTO t_flagged_ord

INDEX e_row_id-index.

  • Call VA03 To View Sales Order Line Item Details

PERFORM call_va03 USING t_flagged_ord-salord4.

WHEN 'SORTL1'.

CLEAR t_pre_prod_ord.

READ TABLE t_pre_prod_ord

INTO t_pre_prod_ord

INDEX e_row_id-index.

  • Call ZSD11 for Customer Search Term

PERFORM call_zsd11_cust_code USING t_pre_prod_ord-sortl1.

WHEN 'SORTL2'.

CLEAR t_delinquent_ord.

READ TABLE t_delinquent_ord

INTO t_delinquent_ord

INDEX e_row_id-index.

  • Call ZSD11 for Customer Search Term

PERFORM call_zsd11_cust_code USING t_delinquent_ord-sortl2.

WHEN 'SORTL3'.

CLEAR t_processed_ord.

READ TABLE t_processed_ord

INTO t_processed_ord

INDEX e_row_id-index.

  • Call ZSD11 for Customer Search Term

PERFORM call_zsd11_cust_code USING t_processed_ord-sortl3.

WHEN 'SORTL4'.

CLEAR t_flagged_ord.

READ TABLE t_flagged_ord

INTO t_flagged_ord

INDEX e_row_id-index.

  • Call ZSD11 for Customer Search Term

PERFORM call_zsd11_cust_code USING t_flagged_ord-sortl4.

WHEN 'IHREZ_E1'.

CLEAR t_pre_prod_ord.

READ TABLE t_pre_prod_ord

INTO t_pre_prod_ord

INDEX e_row_id-index.

  • Call ZSD11 for Mill Order

PERFORM call_zsd11_millorder USING t_pre_prod_ord-ihrez_e1.

WHEN 'IHREZ_E2'.

CLEAR t_delinquent_ord.

READ TABLE t_delinquent_ord

INTO t_delinquent_ord

INDEX e_row_id-index.

  • Call ZSD11 for Mill Order

PERFORM call_zsd11_millorder USING t_delinquent_ord-ihrez_e2.

WHEN 'IHREZ_E3'.

CLEAR t_processed_ord.

READ TABLE t_processed_ord

INTO t_processed_ord

INDEX e_row_id-index.

  • Call ZSD11 for Mill Order

PERFORM call_zsd11_millorder USING t_processed_ord-ihrez_e3.

WHEN 'IHREZ_E4'.

CLEAR t_flagged_ord.

READ TABLE t_flagged_ord

INTO t_flagged_ord

INDEX e_row_id-index.

  • Call ZSD11 for Mill Order

PERFORM call_zsd11_millorder USING t_flagged_ord-ihrez_e4.

WHEN 'NOTES1'.

CLEAR t_pre_prod_ord.

READ TABLE t_pre_prod_ord

INTO t_pre_prod_ord

INDEX e_row_id-index.

  • Call zsd00087 program to edit CSI Memo Text

PERFORM edit_notes USING t_pre_prod_ord-salord1.

WHEN 'NOTES2'.

CLEAR t_delinquent_ord.

READ TABLE t_delinquent_ord

INTO t_delinquent_ord

INDEX e_row_id-index.

  • Call zsd00087 program to edit CSI Memo Text

PERFORM edit_notes USING t_delinquent_ord-salord2.

WHEN 'NOTES3'.

CLEAR t_processed_ord.

READ TABLE t_processed_ord

INTO t_processed_ord

INDEX e_row_id-index.

  • Call zsd00087 program to CSI Memo Text

PERFORM edit_notes USING t_processed_ord-salord3.

WHEN 'NOTES4'.

CLEAR t_flagged_ord.

READ TABLE t_flagged_ord

INTO t_flagged_ord

INDEX e_row_id-index.

  • Call zsd00087 program to CSI Memo Text

PERFORM edit_notes USING t_flagged_ord-salord4.

ENDCASE. " CASE E_COLUMN_ID ...

ENDMETHOD. " HANDLE_HOTSPOT

METHOD handle_top_of_page.

PERFORM write_report_header.

ENDMETHOD. " METHOD HANDLE_TOP_OF_PAGE

*/ Begin of Modification - Request No. DV2K904687

METHOD handle_toolbar.

DATA: ls_toolbar TYPE stb_button.

  • append a separator to normal toolbar

CLEAR ls_toolbar.

MOVE 3 TO ls_toolbar-butn_type.

APPEND ls_toolbar TO e_object->mt_toolbar.

CLEAR ls_toolbar.

  • append a button for Change Delivery Priority

MOVE 'CHNG_PRIO' TO ls_toolbar-function.

MOVE 'Change SO Delivery Priority'(048)

TO ls_toolbar-quickinfo.

MOVE 'Change SO Priority'(049) TO ls_toolbar-text.

MOVE 0 TO ls_toolbar-butn_type.

APPEND ls_toolbar TO e_object->mt_toolbar.

ENDMETHOD. " handle_toolbar

METHOD handle_user_command.

DATA: t_sel_row TYPE lvc_t_roid,

gs_sel_row TYPE lvc_s_roid,

gs_flagged_ord LIKE t_flagged_ord,

lv_lines TYPE i.

CASE e_ucomm.

WHEN 'CHNG_PRIO'.

REFRESH t_sel_row.

CLEAR e_ucomm.

CALL METHOD gv_grid_flagged_ord->get_selected_rows

IMPORTING

et_row_no = t_sel_row.

CLEAR: t_flagged_ord,

gv_vbeln,

gv_posnr,

gv_del_prio.

DESCRIBE TABLE t_sel_row LINES lv_lines.

IF lv_lines GT 1.

MESSAGE i001 WITH 'Select only one row'(043).

ELSEIF lv_lines EQ 1.

READ TABLE t_sel_row INTO gs_sel_row INDEX 1.

READ TABLE t_flagged_ord INTO gs_flagged_ord

INDEX gs_sel_row-row_id.

IF sy-subrc EQ 0.

SPLIT gs_flagged_ord-salord4 AT '-' INTO gv_vbeln gv_posnr.

gv_del_prio = gs_flagged_ord-priority.

CLEAR: s_item, s_item[].

p_sonum = gv_vbeln.

p_delpr = gv_del_prio.

s_item-low = gv_posnr.

APPEND s_item TO s_item.

CLEAR s_item.

ENDIF. " IF sy-subrc EQ 0

ENDIF. " IF lv_lines GT 1

IF lv_lines LE 1.

CALL SELECTION-SCREEN '1100' STARTING AT 30 2

ENDING AT 110 7.

LEAVE TO SCREEN 100.

ENDIF.

ENDCASE. " CASE e_ucomm

ENDMETHOD. " handle_user_command

*/ End of Modification - Request No. DV2K904687

ENDCLASS. " LCL_EVENT_RECEIVER

" IMPLEMENTATION

----


  • Form WRITE_REPORT_HEADER *

----


  • This subroutine displays Report Header which includes *

  • Report Name, Executed by, Execution date, Execution Time *

----


  • There are no parameters to be passed to this subroutine *

----


FORM write_report_header.

DATA lv_rep_tit(72) TYPE c.

FORMAT COLOR COL_KEY.

MOVE sy-title TO lv_rep_tit.

CONDENSE lv_rep_tit.

SKIP 1.

WRITE: /3 sy-repid,

25 'California Steel Industries, Inc.'(040),

75 'Page'(041),

80(4) sy-pagno.

WRITE: /3 sy-uzeit,

25 lv_rep_tit,

75 sy-datum.

FORMAT RESET.

ENDFORM. " WRITE_REPORT_HEADER

----


  • At selection-output *

----


AT SELECTION-SCREEN OUTPUT.

CLEAR sy-ucomm.

IF sy-dynnr EQ '0500'.

  • Initialize layout variant for report-1

CLEAR gs_var_pre_prod_ord.

gs_var_pre_prod_ord-report = sy-cprog.

gs_var_pre_prod_ord-handle = c_handle1.

PERFORM initialize_layoutvariant CHANGING gs_var_pre_prod_ord.

p_var1 = gs_var_pre_prod_ord-variant.

  • Initialize layout variant for report-2

CLEAR gs_var_delinquent_ord.

gs_var_delinquent_ord-report = sy-cprog.

gs_var_delinquent_ord-handle = c_handle2.

PERFORM initialize_layoutvariant CHANGING gs_var_delinquent_ord.

p_var2 = gs_var_delinquent_ord-variant.

  • Initialize layout variant for report-3

CLEAR gs_var_processed_ord.

gs_var_processed_ord-report = sy-cprog.

gs_var_processed_ord-handle = c_handle3.

PERFORM initialize_layoutvariant CHANGING gs_var_processed_ord.

p_var3 = gs_var_processed_ord-variant.

  • Initialize layout variant for report-4

CLEAR gs_var_flagged_ord.

gs_var_flagged_ord-report = sy-cprog.

gs_var_flagged_ord-handle = c_handle4.

PERFORM initialize_layoutvariant CHANGING gs_var_flagged_ord.

p_var4 = gs_var_flagged_ord-variant.

*/ Begin of Modification - Request No. DV2K904687

ELSEIF sy-dynnr EQ '1100'.

DATA t_exclude TYPE TABLE OF sy-ucomm.

SET PF-STATUS 'MENU_1100'.

  • To use your own GUI status for a selection screen

CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'

EXPORTING

p_status = 'MENU_1100'

TABLES

p_exclude = t_exclude.

ENDIF. " IF sy-dynnr EQ '0500'

*/ End of Modification - Request No. DV2K904687

----


  • At Selection Screen *

----


AT SELECTION-SCREEN.

*/ Begin of Modification - Request No. DV2K904687

CASE sy-dynnr.

WHEN '1100'.

IF sy-ucomm IS INITIAL.

CLEAR sy-ucomm.

LEAVE TO SCREEN 1100.

ENDIF. " IF sy-ucomm IS INITIAL

CASE sy-ucomm.

WHEN 'SAVE'.

CLEAR sy-ucomm.

  • Change Delivery Priority using BAPI method

PERFORM change_del_priority.

CLEAR: sy-ucomm,

gv_vbeln,

gv_posnr,

gv_del_prio,

p_sonum,

s_item,

s_item[],

p_delpr.

LEAVE TO SCREEN 0.

WHEN 'CANCEL'.

CLEAR: sy-ucomm,

gv_vbeln,

gv_posnr,

gv_del_prio,

p_sonum,

s_item,

s_item[],

p_delpr.

LEAVE TO SCREEN 0.

ENDCASE. " CASE sy-ucomm

WHEN '0500'.

IF sy-ucomm EQ 'CRET'.

LEAVE TO SCREEN 100.

ELSEIF sy-ucomm IS INITIAL.

LEAVE TO SCREEN 500.

ENDIF. " IF SY-UCOMM EQ 'CRET'

ENDCASE. " CASE sy-dynnr

*/ End of Modification - Request No. DV2K904687

----


  • Selection Screen: Validations *

----


AT SELECTION-SCREEN ON s_pernr.

  • Validate Employee Number

PERFORM validate_employee_number.

AT SELECTION-SCREEN ON s_kunnr.

  • Validate Customer Number

IF NOT s_kunnr IS INITIAL.

PERFORM validate_customer_number.

ENDIF. " IF NOT S_KUNNR IS INITIAL

AT SELECTION-SCREEN ON s_sortl.

  • Validate Search Term

IF NOT s_sortl IS INITIAL.

PERFORM validate_search_term.

ENDIF. " IF NOT S_SORTL IS INITIAL

AT SELECTION-SCREEN ON s_kondm.

  • Validate Product

IF NOT s_kondm IS INITIAL.

PERFORM validate_product.

ENDIF. " IF NOT S_KONDM IS INITIAL

  • Validate p_var1

AT SELECTION-SCREEN ON p_var1.

CLEAR gs_var_pre_prod_ord.

gs_var_pre_prod_ord-report = sy-cprog.

gs_var_pre_prod_ord-handle = c_handle1.

gs_var_pre_prod_ord-variant = p_var1.

IF p_var1 IS NOT INITIAL.

PERFORM validate_variant CHANGING gs_var_pre_prod_ord.

ENDIF. " IF P_VAR1 IS NOT INITIAL

  • Validate p_var2

AT SELECTION-SCREEN ON p_var2.

CLEAR gs_var_delinquent_ord.

gs_var_delinquent_ord-report = sy-cprog.

gs_var_delinquent_ord-handle = c_handle2.

gs_var_delinquent_ord-variant = p_var2.

IF p_var2 IS NOT INITIAL.

PERFORM validate_variant CHANGING gs_var_delinquent_ord.

ENDIF. " IF P_VAR2 IS NOT INITIAL

  • Validate p_var3

AT SELECTION-SCREEN ON p_var3.

CLEAR gs_var_processed_ord.

gs_var_processed_ord-report = sy-cprog.

gs_var_processed_ord-handle = c_handle3.

gs_var_processed_ord-variant = p_var3.

IF p_var3 IS NOT INITIAL.

PERFORM validate_variant CHANGING gs_var_processed_ord.

ENDIF. " IF P_VAR3 IS NOT INITIAL

  • Validate p_var4

AT SELECTION-SCREEN ON p_var4.

CLEAR gs_var_flagged_ord.

gs_var_flagged_ord-report = sy-cprog.

gs_var_flagged_ord-handle = c_handle4.

gs_var_flagged_ord-variant = p_var4.

IF p_var4 IS NOT INITIAL.

PERFORM validate_variant CHANGING gs_var_flagged_ord.

ENDIF. " IF P_VAR4 IS NOT INITIAL

----


  • Selection Screen: Value Request for ALV GRID Variants *

----


AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var1.

CLEAR gs_var_pre_prod_ord.

gs_var_pre_prod_ord-report = sy-cprog.

gs_var_pre_prod_ord-handle = c_handle1.

PERFORM f4_variant CHANGING gs_var_pre_prod_ord

gv_exit.

IF gv_exit NE c_true.

p_var1 = gs_var_pre_prod_ord-variant.

ENDIF. " IF GV_EXIT NE c_true

  • F4 help for variant p_var2

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var2.

CLEAR:

gs_var_delinquent_ord,

gv_exit.

gs_var_delinquent_ord-report = sy-cprog.

gs_var_delinquent_ord-handle = c_handle2.

PERFORM f4_variant CHANGING gs_var_delinquent_ord

gv_exit.

IF gv_exit NE c_true.

p_var2 = gs_var_delinquent_ord-variant.

ENDIF. " IF GV_EXIT NE c_true

  • F4 help for variant p_var3

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var3.

CLEAR:

gs_var_processed_ord,

gv_exit.

gs_var_processed_ord-report = sy-cprog.

gs_var_processed_ord-handle = c_handle3.

PERFORM f4_variant CHANGING gs_var_processed_ord

gv_exit.

IF gv_exit NE c_true.

p_var3 = gs_var_processed_ord-variant.

ENDIF. " IF GV_EXIT NE c_true

  • F4 help for variant p_var4

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var4.

CLEAR:

gs_var_flagged_ord,

gv_exit.

gs_var_flagged_ord-report = sy-cprog.

gs_var_flagged_ord-handle = c_handle4.

PERFORM f4_variant CHANGING gs_var_flagged_ord

gv_exit.

IF gv_exit NE c_true.

p_var4 = gs_var_flagged_ord-variant.

ENDIF. " IF GV_EXIT NE c_true

----


  • Form validate_employee_number *

----


  • This subroutine validates Employee Number *

----


  • There are no parameters to need be passed to this subroutine *

----


FORM validate_employee_number.

DATA lv_pernr LIKE vbpa-pernr.

SELECT SINGLE pernr

INTO lv_pernr

FROM vbpa

WHERE pernr IN s_pernr.

IF sy-subrc NE 0.

MESSAGE e001 WITH text-010.

ENDIF. " IF SY-SUBRC NE 0

CLEAR lv_pernr.

ENDFORM. " VALIDATE_EMPLOYEE_NUMBER

----


  • Form validate_customer_number *

----


  • This subroutine validates Customer Number *

----


  • There are no parameters need to be passed to this subroutine *

----


FORM validate_customer_number.

SELECT SINGLE kunnr

INTO t_common_data-kunnr

FROM kna1

WHERE kunnr IN s_kunnr.

IF sy-subrc NE 0.

MESSAGE e001 WITH text-011.

ENDIF. " IF SY-SUBRC NE 0

CLEAR t_common_data-kunnr.

ENDFORM. " VALIDATE_CUSTOMER_NUMBER

----


  • Form validate_search_term *

----


  • This subroutine validates Search Term *

----


  • There are no parameters need to be passed to this subroutine *

----


FORM validate_search_term.

SELECT SINGLE sortl

INTO t_customer_code-sortl

FROM kna1

WHERE sortl IN s_sortl.

IF sy-subrc NE 0.

MESSAGE e001 WITH text-012.

ENDIF. " IF SY-SUBRC NE 0

CLEAR t_customer_code-sortl.

ENDFORM. " VALIDATE_SEARCH_TERM

----


  • Form validate_product *

----


  • This subroutine validates Product *

----


  • There are no parameters need to be passed to this subroutine *

----


FORM validate_product.

SELECT SINGLE kondm

INTO t_common_data-kondm

FROM t178

WHERE kondm IN s_kondm.

IF sy-subrc NE 0.

MESSAGE e001 WITH text-013.

ENDIF. " IF SY-SUBRC NE 0

CLEAR t_common_data-kondm.

ENDFORM. " VALIDATE_PRODUCT

----


  • Form initialize_layoutvariant *

----


  • This subroutine initializes the layout variants *

----


  • ps_var <-- variant structure *

----


FORM initialize_layoutvariant CHANGING ps_var TYPE disvariant.

CALL FUNCTION 'LVC_VARIANT_DEFAULT_GET'

EXPORTING

i_save = c_save

CHANGING

cs_variant = ps_var

EXCEPTIONS

wrong_input = 1

not_found = 2

program_error = 3

OTHERS = 4.

IF sy-subrc <> 0.

  • Exception Handling Not Required

ENDIF. " IF SY-SUBRC <> 0

ENDFORM. " INITIALIZE_LAYOUTVARINAT

----


  • Form validate_variant *

----


  • This subroutine checks the existence of the ALV GRID variant *

----


  • ps_variant <-- Variant Structure *

----


FORM validate_variant CHANGING ps_variant TYPE disvariant.

CALL FUNCTION 'LVC_VARIANT_EXISTENCE_CHECK'

EXPORTING

i_save = c_save

CHANGING

cs_variant = ps_variant

EXCEPTIONS

wrong_input = 1

not_found = 2

program_error = 3

OTHERS = 4.

IF sy-subrc NE 0.

MESSAGE e001 WITH ps_variant-variant 'Does not Exist'(015).

ENDIF. " IF SY-SUBRC NE 0

ENDFORM. " VALIDATE_VARIANT

----


  • Form f4_variant *

----


  • This subroutine provides F4 help for variant *

----


  • ps_variant <-- Layout Structure *

  • pv_exit <-- Flag for Exit *

----


FORM f4_variant CHANGING ps_variant TYPE disvariant

pv_exit TYPE c.

CALL FUNCTION 'LVC_VARIANT_F4'

EXPORTING

is_variant = ps_variant

i_save = c_save

IMPORTING

e_exit = pv_exit

es_variant = ps_variant

EXCEPTIONS

not_found = 1

program_error = 2

OTHERS = 3.

IF sy-subrc <> 0.

  • Exception Handling Not Required

ENDIF. " IF SY-SUBRC <> 0

ENDFORM. " F4_VARIANT

----


  • Module status_0100 OUTPUT *

----


  • This module sets the Dialog Status and Title to the Screen 100 *

----


MODULE status_0100 OUTPUT.

SET PF-STATUS 'MENU_100'.

SET TITLEBAR 'TITLE'.

*/ Begin of Modification - Request No. DV2K904687

IF gv_flg IS INITIAL.

  • Refresh all internal tables and report output tables

PERFORM refresh_report_tables.

PERFORM refresh_tables.

  • Perform all the Steps to retrieve data for all Reports

PERFORM steps_get_data.

gv_flg = c_true.

ENDIF. " IF GV_FLG IS INITIAL

*/ End of Modification - Request No. DV2K904687

ENDMODULE. " STATUS_0100 OUTPUT

----


  • Module user_command_0100 INPUT *

----


  • This module handles User Commands on Screen 100 *

----


MODULE user_command_0100 INPUT.

gv_okcode = gv_ok_code.

CLEAR gv_ok_code.

CASE gv_okcode.

*/ Begin of Modification - Request No. DV2K904687

WHEN 'REFRESH'.

CLEAR gv_flg.

*/ End of Modification - Request No. DV2K904687

WHEN 'PPP'.

tabstrip_sdpp-activetab = 'PPP'.

gv_number = '0101'.

WHEN 'DIP'.

tabstrip_sdpp-activetab = 'DIP'.

gv_number = '0102'.

WHEN 'PRM'.

tabstrip_sdpp-activetab = 'PRM'.

gv_number = '0103'.

WHEN 'FLO'.

tabstrip_sdpp-activetab = 'FLO'.

gv_number = '0104'.

WHEN 'BACK'.

PERFORM refresh_report_tables.

LEAVE TO SCREEN 500.

WHEN 'EXIT'.

  • Free custom container

PERFORM free_custom_container.

LEAVE PROGRAM.

ENDCASE. " CASE gv_okcode

ENDMODULE. " USER_COMMAND_0100 INPUT

*/ Begin of Modification - Request No. DV2K904687

----


  • Form steps_get_data *

----


  • This subroutine performs all the steps to fetch data for all reports

----


  • There are no parameters to be passed to this subroutine *

----


FORM steps_get_data .

  • Fetch partner function and order status

PERFORM get_partner_function.

  • Fetch sales data for the selection criteria

PERFORM get_sales_data.

  • Fetch customer code for the sales data (Report-1,2,3,4)

PERFORM get_customer_search_term.

  • Fetch CSI File Memo Test for the sales data (Report-1,2,3,4)

PERFORM get_csi_memo_data.

  • Fetch Latest Schedule Line Dates For Sales Data (Report-2)

PERFORM get_schedule_line_date.

  • Fetch Stock Details For Sales Data (Report-3)

PERFORM get_stock.

  • Fetch Released Tons & Delivery Docu Date For Sales Data (Report-3)

PERFORM get_rel_tons_dlvry_date.

LOOP AT t_common_data.

  • Fetch Pre Production Pending Orders (Report-1)

PERFORM get_pre_prod_pending_orders.

  • Fetch Delinquent Orders (Report-2)

PERFORM get_delinquent_orders.

  • Fetch Processed Material Orders That Are To Be Shipped (Report-3)

PERFORM get_processed_orders.

  • Fetch Orders Flagged As Important To The Customer

PERFORM get_flagged_orders.

CLEAR: t_common_data,

t_pre_prod_ord,

t_delinquent_ord,

t_processed_ord,

t_flagged_ord.

ENDLOOP. " LOOP AT T_COMMON_DATA.

SORT t_pre_prod_ord BY sortl1

ihrez_e1

salord1.

SORT t_delinquent_ord BY sortl2

ihrez_e2

salord2.

SORT t_processed_ord BY sortl3

ihrez_e3

salord3.

SORT t_flagged_ord BY sortl4

ihrez_e4

salord4.

  • Refresh Internal tables

PERFORM refresh_tables.

ENDFORM. " steps_get_data

*/ End of Modification - Request No. DV2K904687

----


  • Form get_partner_function *

----


  • This subroutine fetches Partner Function and Order Status *

----


  • There are no parameters to be passed to this subroutine *

----


FORM get_partner_function.

  • For Partner Function

IF p_osr EQ c_true.

gv_parvw = c_rep_zm.

ELSEIF p_isr EQ c_true.

gv_parvw = c_rep_ve.

ELSEIF p_s_mgr EQ c_true.

gv_parvw = c_rep_zi.

ENDIF. " IF P_OSR EQ c_true

  • For Order Status

IF p_open EQ c_true.

gv_abgru = space.

ELSE.

gv_abgru = c_abgru_08.

ENDIF. " IF P_OPEN EQ c_true

ENDFORM. " GET_PARTNER_FUNCTION

----


  • Form get_sales_data *

----


  • This subroutine fetches sales data for the selection criteria *

----


  • There are no parameters need to be passed to this subroutine *

----


FORM get_sales_data.

  • Fetch Sales Data For Selection Criteria

SELECT vbak~kunnr " Customer Number

vbpa~vbeln " Sales Document Number

vbap~posnr " Sales Document Item Number

vbkd~ihrez_e " Mill Order Number

vbap~matnr " Material Number

vbap~pstyv " Sales Document Item Category

vbap~kwmeng " Cumulative Order Quantity

vbap~lprio " Delivery Priority

vbap~werks " Plant

vbap~kondm " Material Pricing Group

*/ Request No. DV2K904687

vbap~aedat " Date of Last Change

vbap~cuobj " Configuration

vbap~zzcust_req_avail " Cust Requested Availabel Date

INTO TABLE t_common_data

FROM vbpa JOIN vbak ON vbpavbeln EQ vbakvbeln

JOIN kna1 ON vbakkunnr EQ kna1kunnr

JOIN vbap ON vbakvbeln EQ vbapvbeln

JOIN vbkd ON vbapvbeln EQ vbkdvbeln

AND vbapposnr EQ vbkdposnr

WHERE vbpa~parvw EQ gv_parvw AND " Partner Function

vbpa~pernr IN s_pernr AND " Personnel Number

vbak~kunnr IN s_kunnr AND " Customer Number

kna1~sortl IN s_sortl AND " Search Term

vbap~kondm IN s_kondm AND " Material Pricing Group

vbap~abgru EQ gv_abgru. " Reason For Rejection

IF sy-subrc NE 0.

MESSAGE i001 WITH text-001.

CLEAR gv_flg.

LEAVE TO SCREEN 500.

ENDIF. " IF SY-SUBRC NE 0.

SORT t_common_data BY vbeln

posnr.

DELETE ADJACENT DUPLICATES

FROM t_common_data

COMPARING vbeln

posnr.

ENDFORM. " GET_SALES_DATA

----


  • Form get_customer_search_term *

----


  • This subroutine fetches customer code search term for the sales data *

----


  • There are no parameters to be passed to this subroutine *

----


FORM get_customer_search_term.

t_cust_temp[] = t_common_data[].

SORT t_cust_temp BY kunnr.

DELETE ADJACENT DUPLICATES

FROM t_cust_temp

COMPARING kunnr.

SELECT sortl " Sort Field

kunnr " Customer Number

FROM zcustcode " Cust Code Table

INTO TABLE t_customer_code

FOR ALL ENTRIES IN t_cust_temp

WHERE kunnr EQ t_cust_temp-kunnr. " Customer Number

IF sy-subrc EQ 0.

SORT t_customer_code BY kunnr.

FREE t_cust_temp.

ENDIF. " IF SY-SUBRC EQ 0.

ENDFORM. " GET_CUSTOMER_SEARCH_TERM

----


  • Form get_csi_memo_data *

----


  • This subroutine fetches CSI memo data for the sales data *

----


  • There are no parameters to be passed to this subroutine *

----


FORM get_csi_memo_data.

SELECT vbeln " Sales document number

posnr " Sales document item

text " CSI memo data text

INTO TABLE t_csi_memo_data

FROM zcsimemo " ZCSIMEMOFILE

FOR ALL ENTRIES IN t_common_data

WHERE vbeln EQ t_common_data-vbeln " Sales document number

AND posnr EQ t_common_data-posnr. " Sales document item

IF sy-subrc EQ 0.

SORT t_csi_memo_data BY vbeln

posnr.

ENDIF. " IF SY-SUBRC EQ 0.

ENDFORM. " GET_CSI_MEMO_DATA

----


  • Form get_customer_code *

----


  • This subroutine fetches the cust.code for the sales order line item *

----


  • pv_kunnr --> Customer Number *

  • pc_sortl <-- Sort Field *

----


FORM get_customer_code USING pv_kunnr TYPE kna1-kunnr

CHANGING pc_sortl TYPE kna1-sortl.

CLEAR t_customer_code.

READ TABLE t_customer_code

WITH KEY kunnr = pv_kunnr

BINARY SEARCH.

IF sy-subrc EQ 0.

pc_sortl = t_customer_code-sortl.

ENDIF. " IF SY-SUBRC EQ 0.

ENDFORM. " GET_CUSTOMER_CODE

----


  • Form get_schedule_line_date *

----


  • This subroutine fetches the latest schedule line data for the sales *

  • order line items *

----


  • There are no parameters to be passed to this subroutine *

----


FORM get_schedule_line_date.

SELECT vbeln " Sales Document Number

posnr " Sales Document Item Number

edatu " Schedule Line Date

INTO TABLE t_schedule_line_date

FROM vbep " Sales Docu:Schedule Line Data

FOR ALL ENTRIES IN t_common_data

WHERE vbeln EQ t_common_data-vbeln

AND posnr EQ t_common_data-posnr

AND bmeng NE 0. " Confirmed Quantity

IF sy-subrc EQ 0.

SORT t_schedule_line_date BY vbeln

posnr

edatu.

DELETE ADJACENT DUPLICATES

FROM t_schedule_line_date

COMPARING vbeln posnr.

ENDIF. " IF SY-SUBRC EQ 0.

ENDFORM. " GET_SCHEDULE_LINE_DATE

----


  • Form get_stock *

----


  • This subroutine fetches stock details of sales data *

----


  • There are no parameters to be passed to this subroutine *

----


FORM get_stock.

SELECT vbeln " Sales Document Number

posnr " Sales Document Item Number

matnr " Material Number

werks " Plant

charg " Batch Number

kalab " Vltd Stock with unrstrctd use

ersda " Creation Date

INTO TABLE t_stock

FROM mska " Sales Order Stock

FOR ALL ENTRIES IN t_common_data

WHERE matnr EQ t_common_data-matnr " Material Number

AND werks EQ t_common_data-werks " Plant

AND vbeln EQ t_common_data-vbeln " Sales Document Number

AND posnr EQ t_common_data-posnr " Sales Document Item Number

AND kalab GT 0. " Valtd Stock With Unrestd Use

IF sy-subrc EQ 0.

SORT t_stock BY vbeln

posnr

ersda.

ENDIF. " IF SY-SUBRC EQ 0.

ENDFORM. " GET_STOCK

----


  • Form get_rel_tons_dlvry_date *

----


  • This subroutine fetches released tons for sales order line items & *

  • document date on the delivery document *

----


  • There are no parameters to be passed to this subroutine *

----


FORM get_rel_tons_dlvry_date.

SELECT vbeln " Delivery

vgbel " Document No of Ref Document

vgpos " Item No of Ref Item

FROM lips " Delivery: Item Data

INTO TABLE t_delivery_data

FOR ALL ENTRIES IN t_common_data

WHERE vgbel EQ t_common_data-vbeln

AND vgpos EQ t_common_data-posnr.

IF sy-subrc EQ 0.

SORT t_delivery_data BY vbeln

vgbel

vgpos.

SELECT vbeln " Delivery

btgew " Total Weight

bldat " Document Date in Document

FROM likp " Delivery Header Data

INTO TABLE t_released_tons_days

FOR ALL ENTRIES IN t_delivery_data

WHERE vbeln EQ t_delivery_data-vbeln

AND wadat_ist EQ c_wadat_ist. " Actual Goods Movement Date

IF sy-subrc EQ 0.

SORT t_released_tons_days BY vbeln

bldat.

ENDIF. " IF SY-SUBRC EQ 0.

ENDIF. " IF SY-SUBRC EQ 0.

ENDFORM. " GET_REL_TONS_DLVRY_DATE

----


  • Form get_sales_order_item *

----


  • This subroutine concatenates Sales Order & Item *

----


  • pv_vbeln --> Sales Document Number *

  • pv_vbeln --> Sales Document Item Number *

  • pc_salord <-- Sales Order & Item *

----


FORM get_sales_order_item USING pv_vbeln LIKE vbap-vbeln

pv_posnr LIKE vbap-posnr

CHANGING pv_salord TYPE any.

DATA:

lv_vbeln LIKE vbap-vbeln,

lv_posnr LIKE vbap-posnr,

lv_len TYPE i.

lv_vbeln = pv_vbeln.

lv_posnr = pv_posnr.

SHIFT lv_vbeln LEFT DELETING LEADING '0'.

SHIFT lv_posnr LEFT DELETING LEADING '0'.

lv_len = STRLEN( lv_posnr ).

IF lv_len LT 2.

CONCATENATE lv_vbeln

lv_posnr

INTO pv_salord

SEPARATED BY '-0'.

ELSE.

CONCATENATE lv_vbeln

lv_posnr

INTO pv_salord

SEPARATED BY '-'.

ENDIF. " IF lv_len LT 2

ENDFORM. " GET_SALES_ORDER_ITEM

----


  • Form get_pre_prod_pending_orders *

----


  • This subrtn fetches orders that are have been entrd but are not open *

  • in the system due to credit, metallurgy, broner or prodn planning *

----


  • There are no parameters to be passed to this subroutine *

----


FORM get_pre_prod_pending_orders.

REFRESH t_lgcyinfo.

IF t_common_data-ihrez_e IS NOT INITIAL.

CALL FUNCTION 'Z_GET_LGCY_ORD_BKLG'

EXPORTING

ihrez_e = t_common_data-ihrez_e

TABLES

itab = t_lgcyinfo[]

EXCEPTIONS

notfound = 1

systemerror = 2

OTHERS = 3.

IF sy-subrc EQ 0 AND t_lgcyinfo[] IS NOT INITIAL.

CLEAR t_pre_prod_ord.

LOOP AT t_lgcyinfo.

IF sy-tabix = 1.

PERFORM get_customer_code USING t_common_data-kunnr

CHANGING t_pre_prod_ord-sortl1.

  • Concatenate Sales Order and Item

PERFORM get_sales_order_item USING t_common_data-vbeln

t_common_data-posnr

CHANGING t_pre_prod_ord-salord1.

  • Fetches Description & Specification of Sales Order Line Item

PERFORM get_descri_speci USING t_common_data-cuobj

CHANGING t_pre_prod_ord-descri

t_pre_prod_ord-speci.

  • Fetches CSI Memo Notes For Sales Order Line Item

PERFORM get_notes USING t_common_data-vbeln

t_common_data-posnr

CHANGING t_pre_prod_ord-notes1.

t_pre_prod_ord-ihrez_e1 = t_common_data-ihrez_e.

ENDIF. " IF SY-TABIX = 1

t_pre_prod_ord-days_entry = t_lgcyinfo-days_since_entry.

t_pre_prod_ord-dept = t_lgcyinfo-bklog.

t_pre_prod_ord-chng_date = t_common_data-aedat.

APPEND t_pre_prod_ord.

CLEAR: t_pre_prod_ord-days_entry,

t_pre_prod_ord-dept.

ENDLOOP. " LOOP AT T_LGCYINFO

ENDIF. " IF SY-SUBRC EQ 0...

ENDIF. " IF T_COMMON_DATA-IHREZ_E

ENDFORM. " GET_PRE_PROD_PENDING_ORDERS

----


  • Form get_delinquent_orders *

----


  • This subroutine fetches orders that are going to miss the avail date *

  • originally agreed to by CSI and the customer. *

----


  • There are no parameters to be passed to this subroutine *

----


FORM get_delinquent_orders.

  • Fetch latest schedule line date for the sales order line item

CLEAR t_schedule_line_date.

READ TABLE t_schedule_line_date

WITH KEY vbeln = t_common_data-vbeln

posnr = t_common_data-posnr

BINARY SEARCH.

IF sy-subrc EQ 0.

IF ( t_common_data-saldata NE space ) AND

( t_common_data-saldata NE t_schedule_line_date-edatu ).

CLEAR t_delinquent_ord.

  • Concatenate Sales Order and Item

PERFORM get_sales_order_item USING t_common_data-vbeln

t_common_data-posnr

CHANGING t_delinquent_ord-salord2.

IF t_pre_prod_ord-salord1 EQ t_delinquent_ord-salord2.

t_delinquent_ord-sortl2 = t_pre_prod_ord-sortl1.

t_delinquent_ord-descri = t_pre_prod_ord-descri.

t_delinquent_ord-speci = t_pre_prod_ord-speci.

t_delinquent_ord-notes2 = t_pre_prod_ord-notes1.

ELSE.

  • Fetches Customer Search Term Of Customer

PERFORM get_customer_code USING t_common_data-kunnr

CHANGING t_delinquent_ord-sortl2.

  • Fetches Description & Specification of Sales Order Line Item

PERFORM get_descri_speci USING t_common_data-cuobj

CHANGING t_delinquent_ord-descri

t_delinquent_ord-speci.

  • Fetches CSI Memo Notes Of Sales Order Line Item

PERFORM get_notes USING t_common_data-vbeln

t_common_data-posnr

CHANGING t_delinquent_ord-notes2.

ENDIF. " IF T_PRE_PROD_ORD-SALORD1...

t_delinquent_ord-ihrez_e2 = t_common_data-ihrez_e.

t_delinquent_ord-saldata = t_common_data-saldata.

t_delinquent_ord-schdate = t_schedule_line_date-edatu.

  • Fetches Days Late, Unit & Days at Unit of the Mill Order

PERFORM get_day_unit.

APPEND t_delinquent_ord.

ENDIF. " IF T_COMMON_DATA-SALDATA LT ...

ENDIF. " IF SY-SUBRC EQ 0.

ENDFORM. " GET_DELINQUENT_ORDERS.

----


  • Form get_day_unit *

----


  • This subroutine fetches Days Late, Days at Unit & Unit of Millorder *

----


  • There are no parameters to be passed to this subroutine *

----


FORM get_day_unit.

REFRESH t_lgcyinfo.

IF t_common_data-ihrez_e IS NOT INITIAL.

CALL FUNCTION 'Z_GET_LGCY_DAYS_LATE_1'

EXPORTING

ihrez_e = t_common_data-ihrez_e

TABLES

itab1 = t_lgcyinfo[]

EXCEPTIONS

notfound = 1

systemerror = 2

OTHERS = 3.

IF sy-subrc EQ 0 AND t_lgcyinfo[] IS NOT INITIAL.

CLEAR t_lgcyinfo.

READ TABLE t_lgcyinfo

WITH KEY millorder = t_common_data-ihrez_e.

IF sy-subrc EQ 0.

t_delinquent_ord-days_late = t_lgcyinfo-dayslate.

t_delinquent_ord-unit = t_lgcyinfo-unit.

t_delinquent_ord-days_at_unit = t_lgcyinfo-daysatunit.

ENDIF. " IF SY-SUBRC EQ 0.

ENDIF. " IF SY-SUBRC EQ 0

ENDIF. " IF T_COMMON_DATA-IHREZ_E...

ENDFORM. " GET_DAY_UNIT

----


  • Form get_processed_orders *

----


  • This subroutine fetches sales orders that are in finished units, *

  • test pending units or bundling units to facilitate shipment. *

----


  • There are no parameters need to be passed to this subroutine *

----


FORM get_processed_orders.

  • Fetches Released Tons & Released Days

PERFORM get_released_tons_days.

  • Fetches Finished & Test-Pending Stock

PERFORM get_finished_testpending_tons.

  • Fetches Bundling Tons

PERFORM get_bundling_tons.

IF gv_fin_tons NE 0 OR

gv_rel_tons NE 0 OR

gv_tb_tons NE 0.

CLEAR t_processed_ord.

  • Concatenate Sales Order and Item

PERFORM get_sales_order_item USING t_common_data-vbeln

t_common_data-posnr

CHANGING t_processed_ord-salord3.

IF t_processed_ord-salord3 EQ t_pre_prod_ord-salord1.

t_processed_ord-sortl3 = t_pre_prod_ord-sortl1.

t_processed_ord-descri = t_pre_prod_ord-descri.

t_processed_ord-speci = t_pre_prod_ord-speci.

t_processed_ord-notes3 = t_pre_prod_ord-notes1.

ELSEIF t_processed_ord-salord3 EQ t_delinquent_ord-salord2.

t_processed_ord-sortl3 = t_delinquent_ord-sortl2.

t_processed_ord-descri = t_delinquent_ord-descri.

t_processed_ord-speci = t_delinquent_ord-speci.

t_processed_ord-notes3 = t_delinquent_ord-notes2.

ELSE.

  • Fetches Customer Search Term Of Customer

PERFORM get_customer_code USING t_common_data-kunnr

CHANGING t_processed_ord-sortl3.

  • Fetches Description & Specification of Sales Order Line Item

PERFORM get_descri_speci USING t_common_data-cuobj

CHANGING t_processed_ord-descri

t_processed_ord-speci.

  • Fetches CSI Memo Notes Of Sales Order Line Item

PERFORM get_notes USING t_common_data-vbeln

t_common_data-posnr

CHANGING t_processed_ord-notes3.

ENDIF. " IF T_PROCESSED_ORD-SALO...

t_processed_ord-ihrez_e3 = t_common_data-ihrez_e.

t_processed_ord-order_tons = t_common_data-kwmeng / 2000.

t_processed_ord-fin_tons = gv_fin_tons.

t_processed_ord-rel_tons = gv_rel_tons.

t_processed_ord-rel_days = gv_rel_days.

  • Fill Test Status of the Stock

IF gv_tp_tons IS NOT INITIAL.

  • If Test Pending Tons is greater than 0 then test status

  • is Test Pending

t_processed_ord-status = c_pending.

ELSEIF gv_bund_tons IS NOT INITIAL.

  • If Test Bundling Tons is greater than 0 and Test Pending

  • Tons is 0 then test status is Test Bundling

t_processed_ord-status = c_bundling.

ELSE.

  • If Test Pending & Test Bundling Tons are 0 then

  • test status is SPACE

t_processed_ord-status = space.

ENDIF. " IF GV_TP_TONS IS NOT...

t_processed_ord-tb_tons = gv_tb_tons.

t_processed_ord-fin_days = gv_fin_days.

APPEND t_processed_ord.

ENDIF. " IF GV_FIN_TONS NE 0 OR ....

ENDFORM. " GET_PROCESSED_ORDERS

----


  • Form get_finished_testpending_tons *

----


  • This subroutine fetches finished and test pending tons for *

  • the sales order line item *

----


  • There are no parameters need to be passed to this subroutine *

----


FORM get_finished_testpending_tons.

CLEAR: gv_net_weight,

gv_pass_stock,

gv_csi_stock,

gv_val_stock,

gv_fin_tons,

gv_tp_tons,

gv_fail_stock,

gv_date.

  • If the Material Pricing Group is PIPE then fetch CSI Stock on Hand,

IF t_common_data-kondm = c_pipe.

  • If Matl.Pricing.Grp is PIPE then fetch Net Weight from MARA

SELECT SINGLE ntgew

INTO gv_net_weight

FROM mara

WHERE matnr = t_common_data-matnr.

  • Obtian CSI Stock

SELECT SINGLE lbkum " Total Valuated Stock

INTO gv_csi_stock

FROM mbew " Material Valuation

WHERE matnr EQ t_common_data-matnr" Material Number

AND bwkey EQ t_common_data-werks" Valuation Area

AND bwtar EQ space. " Valuation Type

ENDIF. " IF T_COMMON_DATA-KONDM...

  • If Matl.Pricing.Grp is other than PIPE then assign '1' to Net Weight

IF gv_net_weight IS INITIAL.

gv_net_weight = 1.

ENDIF. " IF GV_NET_WEIGHT...

gv_date = sy-datum.

LOOP AT t_stock WHERE vbeln EQ t_common_data-vbeln

AND posnr EQ t_common_data-posnr.

CLEAR: gv_obj_key,

gv_config,

gv_lab_result.

  • Fill Object Key concatenating Material No, Plant and Batch No

gv_obj_key = t_stock-matnr.

gv_obj_key+18(4) = t_stock-werks.

gv_obj_key+22(10) = t_stock-charg.

  • Fetch Configuration of the Object Key for the given Batch No

SELECT SINGLE cuobj " Configuration

INTO gv_config

FROM inob " Link b/n Itrnl Num and Object

WHERE obtab EQ c_mcha " Name of Table for Object

AND objek EQ gv_obj_key " Key Obj to be Classified

AND klart EQ c_classtype_022. " Class Type

IF sy-subrc EQ 0.

  • Fetch the Characteristic Value of the characteristic 'LAB RESULT'

SELECT SINGLE atwrt " Characteristic Value

INTO gv_lab_result

FROM ausp " Characteristic Values

WHERE objek EQ gv_config " Key of the Object

AND atinn EQ c_lab_result. " Internal Characteristic

IF sy-subrc EQ 0.

  • If the value of 'LAB RESULT' for the Batch No is 'NONE REQD'

  • or 'PASSED' consider the Stock for Finished Tons else consider

  • the stock for Test Pending tons.

IF gv_lab_result EQ c_none_reqd OR

gv_lab_result EQ c_passed.

gv_pass_stock = gv_pass_stock + t_stock-kalab.

ELSEIF gv_lab_result EQ space.

gv_tp_tons = gv_tp_tons + t_stock-kalab.

gv_fail_stock = gv_fail_stock + t_stock-kalab.

ELSE.

gv_fail_stock = gv_fail_stock + t_stock-kalab.

ENDIF. " IF GV_LAB_RESULT EQ ...

ENDIF. " IF SY-SUBRC EQ 0

ENDIF. " IF SY-SUBRC EQ 0.

  • Populate Finished Days

IF t_stock-ersda LT gv_date.

CLEAR gv_fin_days.

gv_fin_days = sy-datum - t_stock-ersda.

ENDIF. " IF T_STOCK_ERSDA LT GV_DATE...

gv_date = t_stock-ersda.

CLEAR t_stock.

ENDLOOP. " LOOP AT T_STOCK WHERE...

  • Populate Valuated Stock for the Sales Order Line Item, checking the

  • value of Sales Document Item Category is 'ZTAM'(Certificate Manufac)

IF t_common_data-pstyv = c_item_ctgry_ztam.

gv_val_stock = gv_pass_stock.

IF t_common_data-kondm = c_pipe.

gv_val_stock = gv_pass_stock + gv_fail_stock.

ENDIF. " IF T_COMMON_DATA-KONDM...

ELSE.

  • If Sales Document Item Category is other than 'ZTAM' fetch

  • valuated stock from EBEW and subtract Test Pending Tons.

CLEAR gv_pass_stock.

SELECT SINGLE lbkum " Total Valuated Stock

INTO gv_pass_stock

FROM ebew " Sales Order Stock Valuation

WHERE matnr EQ t_common_data-matnr" Material Number

AND bwkey EQ t_common_data-werks" Valuation Area

AND bwtar EQ space " Valuation Type

AND sobkz EQ c_stock_ind_e " Special Stock Indicator

AND vbeln EQ t_common_data-vbeln

AND posnr EQ t_common_data-posnr.

IF sy-subrc EQ 0.

gv_val_stock = gv_pass_stock - gv_fail_stock.

IF t_common_data-kondm = c_pipe.

gv_val_stock = gv_pass_stock.

ENDIF. " IF T_COMMON_DATA-KONDM...

ENDIF. " IF SY-SUBRC EQ 0.

ENDIF. " IF T_COMMON_DATA-PSTYV EQ ...

  • Add CSI Stock on Hand & Valuated Stock to get Finished Stock for the

  • Sales Order Line Item

IF gv_csi_stock GT 0 OR

gv_val_stock GT 0.

gv_fin_tons = ( gv_csi_stock + gv_val_stock ) * gv_net_weight.

gv_fin_tons = gv_fin_tons / 2000.

ENDIF. " IF GV_CSI_STOCK GT 0 OR...

ENDFORM. " GET_FINISHED_TESTPENDING_TONS

----


  • Form get_bundling_tons *

----


  • This subroutine fetches Bundling Tons for the Sales Order Line Item *

----


  • There are no parameters need to be passed to this subroutine *

----


FORM get_bundling_tons.

CLEAR: gv_bund_tons,

gv_tb_tons.

REFRESH t_lgcyinfo.

IF t_common_data-ihrez_e IS NOT INITIAL.

CALL FUNCTION 'Z_GET_LGCY_BDLNG_TONS'

EXPORTING

ihrez_e = t_common_data-ihrez_e

TABLES

itab1 = t_lgcyinfo[]

EXCEPTIONS

notfound = 1

systemerror = 2

OTHERS = 3.

IF sy-subrc EQ 0 AND t_lgcyinfo[] IS NOT INITIAL.

LOOP AT t_lgcyinfo.

gv_bund_tons = gv_bund_tons + t_lgcyinfo-tons.

ENDLOOP. " LOOP AT T_LGCYINFO

ENDIF. " IF SY-SUBRC EQ 0

ENDIF. " IF T_COMMON_DATA-IHREZ_E...

  • Add Bundling Tons and Test Pending Tons to obtain Test/Bundling

  • Tons

gv_tb_tons = ( gv_tp_tons ) / 2000 + gv_bund_tons.

ENDFORM. " GET_BUNDLING_TONS

----


  • Form get_released_tons_DAYS *

----


  • This subroutine fetches Released Tons & Released Days for the Sales *

  • Order Line Item *

----


  • There are no parameters need to be passed to this subroutine *

----


FORM get_released_tons_days.

CLEAR: gv_rel_tons,

gv_rel_days,

gv_no_delivery.

IF t_released_tons_days[] IS NOT INITIAL.

  • Consider all delivery documents for curreent Sales Order Line Item

LOOP AT t_delivery_data WHERE vgbel EQ t_common_data-vbeln

AND vgpos EQ t_common_data-posnr.

CLEAR t_released_tons_days.

  • Fetch released tons for each delivery document

READ TABLE t_released_tons_days

WITH KEY vbeln = t_delivery_data-vbeln

BINARY SEARCH.

IF sy-subrc EQ 0.

  • Sum released tons for each delivery.

gv_rel_tons = gv_rel_tons + t_released_tons_days-btgew.

  • Count the number of delivery document dates for all

  • deliveries for a Sales Order Line Item and Sum released days

IF t_released_tons_days-bldat NE c_wadat_ist.

gv_rel_days = gv_rel_days +

( sy-datum - t_released_tons_days-bldat ).

gv_no_delivery = gv_no_delivery + 1.

ENDIF. " IF T_RELEASED_TONS_DAYS-BLDAT..

ENDIF. " IF SY-SUBRC EQ 0.

ENDLOOP. " LOOP AT T_DELIVERY_DATA...

  • Calculate released tons and Average released days.

gv_rel_tons = gv_rel_tons / 2000.

IF gv_no_delivery NE 0.

gv_rel_days = gv_rel_days / gv_no_delivery.

ENDIF. " IF GV_NO_DELIVERY NE 0

ENDIF. " IF T_RELEASED_TONS_DAYS[]...

ENDFORM. " GET_RELEASED_TONS_DAYS

----


  • Form get_flagged_orders *

----


  • This subroutine fetches sales orders flagged as important to the cust*

----


  • There are no parameters need to be passed to this subroutine *

----


FORM get_flagged_orders.

IF t_common_data-lprio NE c_normal.

CLEAR t_flagged_ord.

  • Concatenate Sales Order and Item

PERFORM get_sales_order_item USING t_common_data-vbeln

t_common_data-posnr

CHANGING t_flagged_ord-salord4.

IF t_flagged_ord-salord4 EQ t_pre_prod_ord-salord1.

t_flagged_ord-sortl4 = t_pre_prod_ord-sortl1.

t_flagged_ord-descri = t_pre_prod_ord-descri.

t_flagged_ord-speci = t_pre_prod_ord-speci.

t_flagged_ord-notes4 = t_pre_prod_ord-notes1.

ELSEIF t_flagged_ord-salord4 EQ t_delinquent_ord-salord2.

t_flagged_ord-sortl4 = t_delinquent_ord-sortl2.

t_flagged_ord-descri = t_delinquent_ord-descri.

t_flagged_ord-speci = t_delinquent_ord-speci.

t_flagged_ord-notes4 = t_delinquent_ord-notes2.

ELSEIF t_flagged_ord-salord4 EQ t_processed_ord-salord3.

t_flagged_ord-sortl4 = t_processed_ord-sortl3.

t_flagged_ord-descri = t_processed_ord-descri.

t_flagged_ord-speci = t_processed_ord-speci.

t_flagged_ord-notes4 = t_processed_ord-notes3.

ELSE.

  • Fetches Customer Search Term Of Customer

PERFORM get_customer_code USING t_common_data-kunnr

CHANGING t_flagged_ord-sortl4.

  • Fetches Description & Specification of Sales Order Line Item

PERFORM get_descri_speci USING t_common_data-cuobj

CHANGING t_flagged_ord-descri

t_flagged_ord-speci.

  • Fetches CSI Memo Notes Of Sales Order Line Item

PERFORM get_notes USING t_common_data-vbeln

t_common_data-posnr

CHANGING t_flagged_ord-notes4.

ENDIF. " IF T_FLAGGED_ORD-SALORD4 EQ...

t_flagged_ord-ihrez_e4 = t_common_data-ihrez_e.

t_flagged_ord-saldata = t_common_data-saldata.

t_flagged_ord-priority = t_common_data-lprio.

APPEND t_flagged_ord.

gv_tabix = sy-tabix.

REFRESH t_lgcyinfo.

IF t_common_data-ihrez_e IS NOT INITIAL.

CALL FUNCTION 'Z_GET_LGCY_UNIT_TONS'

EXPORTING

ihrez_e = t_common_data-ihrez_e

TABLES

itab1 = t_lgcyinfo[]

EXCEPTIONS

notfound = 1

systemerror = 2

OTHERS = 3.

IF sy-subrc EQ 0 AND t_lgcyinfo[] IS NOT INITIAL.

CLEAR t_lgcyinfo.

LOOP AT t_lgcyinfo.

t_flagged_ord-unit = t_lgcyinfo-unit.

t_flagged_ord-tons = t_lgcyinfo-tons.

IF sy-tabix EQ 1.

MODIFY t_flagged_ord INDEX gv_tabix

TRANSPORTING unit tons.

CLEAR gv_tabix.

ELSE.

APPEND t_flagged_ord.

ENDIF. " IF SY-TABIX EQ 1

CLEAR t_lgcyinfo.

ENDLOOP. " LOOP AT T_LGCYINFO.

ENDIF. " T_COMMON_DATA-LPRIO EQ...

ENDIF. " IF SY-SUBRC EQ1 0

ENDIF. " IF T_COMMON_DATA-IHREZ_E...

ENDFORM. " GET_FLAGGED_ORDERS.

----


  • Form get_descri_speci *

----


  • This subroutine fetches Description & Specificaiton of sales data *

----


  • pv_cuobj --> Configuration *

  • pv_descri <-- Description of Sales Order Item *

  • pv_speci <-- Specification of Sales Order Item *

----


FORM get_descri_speci USING pv_cuobj TYPE vbap-cuobj

CHANGING pc_descri TYPE any

pv_speci TYPE any.

REFRESH t_configuration.

  • Get Material Description and Specification

CALL FUNCTION 'VC_I_GET_CONFIGURATION_IBASE'

EXPORTING

instance = pv_cuobj

TABLES

configuration = t_configuration[]

EXCEPTIONS

instance_not_found = 1

OTHERS = 2.

IF sy-subrc EQ 0 AND t_configuration[] IS NOT INITIAL.

CLEAR t_configuration.

READ TABLE t_configuration WITH KEY atnam = c_eng_metric.

IF sy-subrc EQ 0.

  • If Characteristic Name is 'ENGLISH_METRIC' and

  • Characteristic Value is 'E'

IF t_configuration-atwrt EQ c_stock_ind_e.

CLEAR t_configuration.

READ TABLE t_configuration WITH KEY atnam = c_gauge.

IF sy-subrc EQ 0.

gv_gauge = t_configuration-atwtb.

ENDIF. " IF SY-SUBRC EQ 0

CLEAR t_configuration.

READ TABLE t_configuration WITH KEY atnam = c_width.

IF sy-subrc EQ 0.

gv_width = t_configuration-atwtb.

ENDIF. " IF SY-SUBRC EQ 0

ELSE.

  • If Characteristic Name is 'ENGLISH_METRIC' and

  • Characteristic Value is not equal to 'E'

CLEAR t_configuration.

READ TABLE t_configuration WITH KEY atnam = c_gauge_metric.

IF sy-subrc EQ 0.

gv_gauge = t_configuration-atwtb.

ENDIF. " IF SY-SUBRC EQ 0

CLEAR t_configuration.

READ TABLE t_configuration WITH KEY atnam = c_width_metric.

IF sy-subrc EQ 0.

gv_width = t_configuration-atwtb.

ENDIF. " IF SY-SUBRC EQ 0

ENDIF. " IF SY-SUBRC EQ 0

ENDIF. " IF SY-SUBRC EQ 0 AND...

IF gv_gauge IS NOT INITIAL AND

gv_width IS NOT INITIAL.

CONCATENATE gv_gauge

'x'

gv_width

'x'

c_coil

INTO pc_descri

SEPARATED BY space.

CLEAR: gv_gauge,

gv_width.

ENDIF. " IF GV_GAUGE IS NOT...

CLEAR t_configuration.

READ TABLE t_configuration WITH KEY atnam = c_spec_bf.

IF sy-subrc EQ 0.

pv_speci = t_configuration-atwtb.

ENDIF. " IF SY-SUBRC EQ 0

ENDIF. " IF SY-SUBRC EQ 0

ENDFORM. " GET_DESCRI_SPECI

----


  • Form get_notes *

----


  • This subroutine fetches CSI memo text for the sales data line item *

----


  • pv_vbeln --> Sales Order Number *

  • pv_posnr --> Sales Order Item Number *

  • pc_notes <-- CSI Memo Text *

----


FORM get_notes USING pv_vbeln TYPE vbap-vbeln

pv_posnr TYPE vbap-posnr

CHANGING pv_notes TYPE zcsimemo-text.

CLEAR t_csi_memo_data.

READ TABLE t_csi_memo_data

WITH KEY vbeln = pv_vbeln

posnr = pv_posnr

BINARY SEARCH.

IF sy-subrc EQ 0.

pv_notes = t_csi_memo_data-text+0(20).

ENDIF. " IF SY-SUBRC EQ 0

ENDFORM. " GET_NOTES

----


  • Form free_custom_container *

----


  • This subroutine frees Custom Containers *

----


  • There are no parameters to be passed to this subroutine *

----


FORM free_custom_container.

IF gv_cont_pre_prod_ord IS NOT INITIAL.

CALL METHOD gv_cont_pre_prod_ord->free.

CLEAR gv_cont_pre_prod_ord.

ENDIF. " IF GV_CONT_PRE_PROD_ORD IS...

IF gv_cont_delinquent_ord IS NOT INITIAL.

CALL METHOD gv_cont_delinquent_ord->free.

CLEAR gv_cont_delinquent_ord.

ENDIF. " IF GV_CONT_DELINQUENT_ORD...

IF gv_cont_processed_ord IS NOT INITIAL.

CALL METHOD gv_cont_processed_ord->free.

CLEAR gv_cont_processed_ord.

ENDIF. " IF GV_CONT_PROCESSED_ORD...

IF gv_cont_flagged_ord IS NOT INITIAL.

CALL METHOD gv_cont_flagged_ord->free.

CLEAR gv_cont_flagged_ord.

ENDIF. " IF GV_CONT_FLAGGED_ORD IS...

CALL METHOD cl_gui_cfw=>flush.

ENDFORM. " FREE_CUSTOM_CONTAINER

----


  • Module STATUS_0101 OUTPUT *

----


  • This module creates objects for Container & Grid to display Pre *

  • Production Pending Details *

----


MODULE status_0101 OUTPUT.

IF gv_cont_pre_prod_ord IS INITIAL.

CREATE OBJECT gv_cont_pre_prod_ord

EXPORTING

container_name = c_cont_pre_prod_ord.

CREATE OBJECT gv_grid_pre_prod_ord

EXPORTING

i_parent = gv_cont_pre_prod_ord.

  • Fill layout for PPP report

gs_lay_pre_prod_ord-zebra = c_true.

gs_lay_pre_prod_ord-grid_title = text-002.

gs_lay_pre_prod_ord-cwidth_opt = c_true.

gs_lay_pre_prod_ord-sel_mode = c_save.

  • Fill field caltalog for PPP report

PERFORM fill_fieldcat_pre_prod_ord.

  • Exclude Buttons From Toolbar

PERFORM fill_toolbar.

CALL METHOD gv_grid_pre_prod_ord->set_table_for_first_display

EXPORTING

is_variant = gs_var_pre_prod_ord

i_save = c_save

is_layout = gs_lay_pre_prod_ord

it_toolbar_excluding = t_exclude

CHANGING

it_outtab = t_pre_prod_ord[]

it_fieldcatalog = t_fcat_pre_prod_ord[].

CREATE OBJECT gv_event_receiver.

SET HANDLER gv_event_receiver->handle_hotspot

FOR gv_grid_pre_prod_ord.

SET HANDLER gv_event_receiver->handle_top_of_page

FOR gv_grid_pre_prod_ord.

ELSE.

CALL METHOD gv_grid_pre_prod_ord->refresh_table_display

EXPORTING

i_soft_refresh = c_true.

ENDIF. " IF GV_CONT_PRE_PROD_ORD IS...

ENDMODULE. " STATUS_0101 OUTPUT

----


  • Form fill_fieldcat_pre_prod_ord *

----


  • This subroutine fills the Field Catalog for Pre Production Pending *

  • Orders report *

----


  • There are no parameters need to be passed to this subroutine *

----


FORM fill_fieldcat_pre_prod_ord.

CLEAR t_fcat_pre_prod_ord.

t_fcat_pre_prod_ord-col_pos = 1.

t_fcat_pre_prod_ord-fieldname = 'SORTL1'.

t_fcat_pre_prod_ord-ref_table = 'KNA1'.

t_fcat_pre_prod_ord-ref_field = 'SORTL'.

t_fcat_pre_prod_ord-outputlen = 6.

t_fcat_pre_prod_ord-coltext = 'CC'(016).

t_fcat_pre_prod_ord-seltext = 'Customer Code'(017).

t_fcat_pre_prod_ord-hotspot = c_true.

APPEND t_fcat_pre_prod_ord.

CLEAR t_fcat_pre_prod_ord.

t_fcat_pre_prod_ord-col_pos = 2.

t_fcat_pre_prod_ord-fieldname = 'IHREZ_E1'.

t_fcat_pre_prod_ord-ref_table = 'VBKD'.

t_fcat_pre_prod_ord-ref_field = 'IHREZ_E'.

t_fcat_pre_prod_ord-coltext = 'Mill Order'(018).

t_fcat_pre_prod_ord-seltext = 'Mill Order'(018).

t_fcat_pre_prod_ord-hotspot = c_true.

APPEND t_fcat_pre_prod_ord.

CLEAR t_fcat_pre_prod_ord.

t_fcat_pre_prod_ord-col_pos = 3.

t_fcat_pre_prod_ord-fieldname = 'SALORD1'.

t_fcat_pre_prod_ord-inttype = 'C'.

t_fcat_pre_prod_ord-outputlen = 17.

t_fcat_pre_prod_ord-coltext = 'SAP Order & Item'(019).

t_fcat_pre_prod_ord-seltext = 'SAP Order & Item'(019).

t_fcat_pre_prod_ord-scrtext_l = 'SAP Order & Item'(019).

t_fcat_pre_prod_ord-hotspot = c_true.

APPEND t_fcat_pre_prod_ord.

CLEAR t_fcat_pre_prod_ord.

t_fcat_pre_prod_ord-col_pos = 4.

t_fcat_pre_prod_ord-fieldname = 'DESCRI'.

t_fcat_pre_prod_ord-inttype = 'C'.

t_fcat_pre_prod_ord-outputlen = 70.

t_fcat_pre_prod_ord-coltext = 'Description'(020).

t_fcat_pre_prod_ord-seltext = 'Description'(020).

t_fcat_pre_prod_ord-scrtext_l = 'Description'(020).

APPEND t_fcat_pre_prod_ord.

CLEAR t_fcat_pre_prod_ord.

t_fcat_pre_prod_ord-col_pos = 5.

t_fcat_pre_prod_ord-fieldname = 'SPECI'.

t_fcat_pre_prod_ord-inttype = 'C'.

t_fcat_pre_prod_ord-outputlen = 30.

t_fcat_pre_prod_ord-coltext = 'Specification'(021).

t_fcat_pre_prod_ord-seltext = 'Specification'(021).

t_fcat_pre_prod_ord-scrtext_l = 'Specification'(021).

APPEND t_fcat_pre_prod_ord.

CLEAR t_fcat_pre_prod_ord.

t_fcat_pre_prod_ord-col_pos = 6.

t_fcat_pre_prod_ord-fieldname = 'DAYS_ENTRY'.

t_fcat_pre_prod_ord-ref_table = 'ZLGCYINFO'.

t_fcat_pre_prod_ord-ref_field = 'DAYS_SINCE_ENTRY'.

t_fcat_pre_prod_ord-coltext = 'Days Since Entry'(022).

t_fcat_pre_prod_ord-seltext = 'Days Since Entry'(022).

t_fcat_pre_prod_ord-no_zero = c_true.

APPEND t_fcat_pre_prod_ord.

CLEAR t_fcat_pre_prod_ord.

t_fcat_pre_prod_ord-col_pos = 7.

t_fcat_pre_prod_ord-fieldname = 'DEPT'.

t_fcat_pre_prod_ord-ref_table = 'ZLGCYINFO'.

t_fcat_pre_prod_ord-ref_field = 'BKLOG'.

t_fcat_pre_prod_ord-coltext = 'Department'(023).

t_fcat_pre_prod_ord-seltext = 'Department'(023).

APPEND t_fcat_pre_prod_ord.

CLEAR t_fcat_pre_prod_ord.

t_fcat_pre_prod_ord-col_pos = 8.

t_fcat_pre_prod_ord-fieldname = 'NOTES1'.

t_fcat_pre_prod_ord-ref_table = 'ZCSIMEMO'.

t_fcat_pre_prod_ord-ref_field = 'TEXT'.

t_fcat_pre_prod_ord-coltext = 'Notes'(024).

t_fcat_pre_prod_ord-seltext = 'Notes'(024).

t_fcat_pre_prod_ord-hotspot = c_true.

APPEND t_fcat_pre_prod_ord.

*/ Begin of Modification - Request No. DV2K904687

CLEAR t_fcat_pre_prod_ord.

t_fcat_pre_prod_ord-col_pos = 9.

t_fcat_pre_prod_ord-fieldname = 'CHNG_DATE'.

t_fcat_pre_prod_ord-ref_table = 'VBAP'.

t_fcat_pre_prod_ord-ref_field = 'AEDAT'.

t_fcat_pre_prod_ord-coltext = 'Change Date'(042).

t_fcat_pre_prod_ord-seltext = 'Change Date'(042).

APPEND t_fcat_pre_prod_ord.

*/ End of Modification - Request No. DV2K904687

ENDFORM. " FILL_FIELDCAT_PRE_PROD_ORD

----


  • Module STATUS_0102 OUTPUT *

----


  • This module creates objects for Container & Grid to display *

  • Delinquent In Process Details *

----


MODULE status_0102 OUTPUT.

IF gv_cont_delinquent_ord IS INITIAL.

CREATE OBJECT gv_cont_delinquent_ord

EXPORTING

container_name = c_cont_delinquent_ord.

CREATE OBJECT gv_grid_delinquent_ord

EXPORTING

i_parent = gv_cont_delinquent_ord.

  • Fill layout for DIP report

gs_lay_delinquent_ord-zebra = c_true.

gs_lay_delinquent_ord-grid_title = text-003.

gs_lay_delinquent_ord-cwidth_opt = c_true.

gs_lay_delinquent_ord-sel_mode = c_save.

  • Fill field caltalog for DIP report

PERFORM fill_fieldcat_delinquent_ord.

  • Exclude Buttons From Toolbar

PERFORM fill_toolbar.

CALL METHOD gv_grid_delinquent_ord->set_table_for_first_display

EXPORTING

is_variant = gs_var_delinquent_ord

i_save = c_save

it_toolbar_excluding = t_exclude

is_layout = gs_lay_delinquent_ord

CHANGING

it_outtab = t_delinquent_ord[]

it_fieldcatalog = t_fcat_delinquent_ord[].

CREATE OBJECT gv_event_receiver.

SET HANDLER gv_event_receiver->handle_hotspot

FOR gv_grid_delinquent_ord.

SET HANDLER gv_event_receiver->handle_top_of_page

FOR gv_grid_delinquent_ord.

ELSE.

CALL METHOD gv_grid_delinquent_ord->refresh_table_display.

ENDIF. " IF GV_CONT_DELINQUENT_ORD...

ENDMODULE. " STATUS_0102 OUTPUT

----


  • Form fill_fieldcat_delinquent_ord *

----


  • This subroutine fills the Field Catalog for Delinquent In Process *

  • Orders report *

----


  • There are no parameters need to be passed to this subroutine *

----


FORM fill_fieldcat_delinquent_ord .

CLEAR t_fcat_delinquent_ord.

t_fcat_delinquent_ord-col_pos = 1.

t_fcat_delinquent_ord-fieldname = 'SORTL2'.

t_fcat_delinquent_ord-ref_table = 'KNA1'.

t_fcat_delinquent_ord-ref_field = 'SORTL'.

t_fcat_delinquent_ord-coltext = 'CC'(016).

t_fcat_delinquent_ord-seltext = 'Customer Code'(017).

t_fcat_delinquent_ord-hotspot = c_true.

APPEND t_fcat_delinquent_ord.

CLEAR t_fcat_delinquent_ord.

t_fcat_delinquent_ord-col_pos = 2.

t_fcat_delinquent_ord-fieldname = 'IHREZ_E2'.

t_fcat_delinquent_ord-ref_table = 'VBKD'.

t_fcat_delinquent_ord-ref_field = 'IHREZ_E'.

t_fcat_delinquent_ord-coltext = 'Mill Order'(018).

t_fcat_delinquent_ord-seltext = 'Mill Order'(018).

t_fcat_delinquent_ord-hotspot = c_true.

APPEND t_fcat_delinquent_ord.

CLEAR t_fcat_delinquent_ord.

t_fcat_delinquent_ord-col_pos = 3.

t_fcat_delinquent_ord-fieldname = 'SALORD2'.

t_fcat_delinquent_ord-inttype = 'C'.

t_fcat_delinquent_ord-outputlen = 17.

t_fcat_delinquent_ord-coltext = 'SAP Order & Item'(019).

t_fcat_delinquent_ord-seltext = 'SAP Order & Item'(019).

t_fcat_delinquent_ord-scrtext_l = 'SAP Order & Item'(019).

t_fcat_delinquent_ord-hotspot = c_true.

APPEND t_fcat_delinquent_ord.

CLEAR t_fcat_delinquent_ord.

t_fcat_delinquent_ord-col_pos = 4.

t_fcat_delinquent_ord-fieldname = 'DESCRI'.

t_fcat_delinquent_ord-inttype = 'C'.

t_fcat_delinquent_ord-outputlen = 70.

t_fcat_delinquent_ord-coltext = 'Description'(020).

t_fcat_delinquent_ord-seltext = 'Description'(020).

t_fcat_delinquent_ord-scrtext_l = 'Description'(020).

APPEND t_fcat_delinquent_ord.

CLEAR t_fcat_delinquent_ord.

t_fcat_delinquent_ord-col_pos = 5.

t_fcat_delinquent_ord-fieldname = 'SPECI'.

t_fcat_delinquent_ord-inttype = 'C'.

t_fcat_delinquent_ord-outputlen = 30.

t_fcat_delinquent_ord-coltext = 'Specification'(021).

t_fcat_delinquent_ord-seltext = 'Specification'(021).

t_fcat_delinquent_ord-scrtext_l = 'Specification'(021).

APPEND t_fcat_delinquent_ord.

CLEAR t_fcat_delinquent_ord.

t_fcat_delinquent_ord-col_pos = 6.

t_fcat_delinquent_ord-fieldname = 'SALDATA'.

t_fcat_delinquent_ord-ref_table = 'VBAP'.

t_fcat_delinquent_ord-ref_field = 'ZZCUST_REQ_AVAIL'.

t_fcat_delinquent_ord-coltext = 'Sales Data B'(025).

t_fcat_delinquent_ord-seltext = 'Customer Requested Date'(026).

APPEND t_fcat_delinquent_ord.

CLEAR t_fcat_delinquent_ord.

t_fcat_delinquent_ord-col_pos = 7.

t_fcat_delinquent_ord-fieldname = 'SCHDATE'.

t_fcat_delinquent_ord-ref_table = 'VBEP'.

t_fcat_delinquent_ord-ref_field = 'EDATU'.

t_fcat_delinquent_ord-coltext = 'Current Available Date'(027).

t_fcat_delinquent_ord-seltext = 'Current Available Date'(027).

APPEND t_fcat_delinquent_ord.

CLEAR t_fcat_delinquent_ord.

t_fcat_delinquent_ord-col_pos = 8.

t_fcat_delinquent_ord-fieldname = 'DAYS_LATE'.

t_fcat_delinquent_ord-ref_table = 'ZLGCYINFO'.

t_fcat_delinquent_ord-ref_field = 'DAYSLATE'.

t_fcat_delinquent_ord-coltext = 'Days Late'(028).

t_fcat_delinquent_ord-seltext = 'Days Late'(028).

t_fcat_delinquent_ord-no_zero = c_true.

APPEND t_fcat_delinquent_ord.

CLEAR t_fcat_delinquent_ord.

t_fcat_delinquent_ord-col_pos = 9.

t_fcat_delinquent_ord-fieldname = 'UNIT'.

t_fcat_delinquent_ord-ref_table = 'ZLGCYINFO'.

t_fcat_delinquent_ord-coltext = 'Unit'(029).

t_fcat_delinquent_ord-seltext = 'Unit'(029).

APPEND t_fcat_delinquent_ord.

CLEAR t_fcat_delinquent_ord.

t_fcat_delinquent_ord-col_pos = 10.

t_fcat_delinquent_ord-fieldname = 'DAYS_AT_UNIT'.

t_fcat_delinquent_ord-ref_table = 'ZLGCYINFO'.

t_fcat_delinquent_ord-ref_field = 'DAYSATUNIT'.

t_fcat_delinquent_ord-coltext = 'Days at Unit'(030).

t_fcat_delinquent_ord-seltext = 'Days at Unit'(030).

t_fcat_delinquent_ord-no_zero = c_true.

APPEND t_fcat_delinquent_ord.

CLEAR t_fcat_delinquent_ord.

t_fcat_delinquent_ord-col_pos = 11.

t_fcat_delinquent_ord-fieldname = 'NOTES2'.

t_fcat_delinquent_ord-ref_table = 'ZCSIMEMO'.

t_fcat_delinquent_ord-ref_field = 'TEXT'.

t_fcat_delinquent_ord-coltext = 'Notes'(024).

t_fcat_delinquent_ord-seltext = 'Notes'(024).

t_fcat_delinquent_ord-hotspot = c_true.

APPEND t_fcat_delinquent_ord.

ENDFORM. " FILL_FIELDCAT_....

----


  • Module STATUS_0103 OUTPUT *

----


  • This module creates objects for Container & Grid to display *

  • Process Materai Ready For Shipment Order details *

----


MODULE status_0103 OUTPUT.

IF gv_cont_processed_ord IS INITIAL.

CREATE OBJECT gv_cont_processed_ord

EXPORTING

container_name = c_cont_processed_ord.

CREATE OBJECT gv_grid_processed_ord

EXPORTING

i_parent = gv_cont_processed_ord.

  • Fill layout for PMS report

gs_lay_processed_ord-zebra = c_true.

gs_lay_processed_ord-grid_title = text-008.

gs_lay_processed_ord-cwidth_opt = c_true.

gs_lay_processed_ord-sel_mode = c_save.

  • Fill field caltalog for PMS report

PERFORM fill_fieldcat_processed_ord.

  • Exclude Buttons From Toolbar

PERFORM fill_toolbar.

CALL METHOD gv_grid_processed_ord->set_table_for_first_display

EXPORTING

is_variant = gs_var_processed_ord

i_save = c_save

it_toolbar_excluding = t_exclude

is_layout = gs_lay_processed_ord

CHANGING

it_outtab = t_processed_ord[]

it_fieldcatalog = t_fcat_processed_ord[].

CREATE OBJECT gv_event_receiver.

SET HANDLER gv_event_receiver->handle_hotspot

FOR gv_grid_processed_ord.

SET HANDLER gv_event_receiver->handle_top_of_page

FOR gv_grid_processed_ord.

ELSE.

CALL METHOD gv_grid_processed_ord->refresh_table_display.

ENDIF. " IF GV_CONT_PROCESSED_ORD IS ...

ENDMODULE. " STATUS_0103 OUTPUT

----


  • Form fill_fieldcat_processed_ord *

----


  • This subroutine fills the Field Catalog for Processed Material *

  • Ready for Shipment Details *

----


  • There are no parameters need to be passed to this subroutine *

----


FORM fill_fieldcat_processed_ord.

CLEAR t_fcat_processed_ord.

t_fcat_processed_ord-col_pos = 1.

t_fcat_processed_ord-fieldname = 'SORTL3'.

t_fcat_processed_ord-ref_table = 'KNA1'.

t_fcat_processed_ord-ref_field = 'SORTL'.

t_fcat_processed_ord-coltext = 'CC'(016).

t_fcat_processed_ord-seltext = 'Customer Code'(017).

t_fcat_processed_ord-hotspot = c_true.

APPEND t_fcat_processed_ord.

CLEAR t_fcat_processed_ord.

t_fcat_processed_ord-col_pos = 2.

t_fcat_processed_ord-fieldname = 'IHREZ_E3'.

t_fcat_processed_ord-ref_table = 'VBKD'.

t_fcat_processed_ord-ref_field = 'IHREZ_E'.

t_fcat_processed_ord-coltext = 'Mill Order'(018).

t_fcat_processed_ord-seltext = 'Mill Order'(018).

t_fcat_processed_ord-hotspot = c_true.

APPEND t_fcat_processed_ord.

CLEAR t_fcat_processed_ord.

t_fcat_processed_ord-col_pos = 3.

t_fcat_processed_ord-fieldname = 'SALORD3'.

t_fcat_processed_ord-inttype = 'C'.

t_fcat_processed_ord-outputlen = 17.

t_fcat_processed_ord-coltext = 'SAP Order & Item'(019).

t_fcat_processed_ord-seltext = 'SAP Order & Item'(019).

t_fcat_processed_ord-scrtext_l = 'SAP Order & Item'(019).

t_fcat_processed_ord-hotspot = c_true.

APPEND t_fcat_processed_ord.

CLEAR t_fcat_processed_ord.

t_fcat_processed_ord-col_pos = 4.

t_fcat_processed_ord-fieldname = 'DESCRI'.

t_fcat_processed_ord-inttype = 'C'.

t_fcat_processed_ord-outputlen = 70.

t_fcat_processed_ord-coltext = 'Description'(020).

t_fcat_processed_ord-seltext = 'Description'(020).

t_fcat_processed_ord-scrtext_l = 'Description'(020).

APPEND t_fcat_processed_ord.

CLEAR t_fcat_processed_ord.

t_fcat_processed_ord-col_pos = 5.

t_fcat_processed_ord-fieldname = 'SPECI'.

t_fcat_processed_ord-inttype = 'C'.

t_fcat_processed_ord-outputlen = '30'.

t_fcat_processed_ord-coltext = 'Specification'(021).

t_fcat_processed_ord-seltext = 'Specification'(021).

t_fcat_processed_ord-scrtext_l = 'Specification'(021).

APPEND t_fcat_processed_ord.

CLEAR t_fcat_processed_ord.

t_fcat_processed_ord-col_pos = 6.

t_fcat_processed_ord-fieldname = 'ORDER_TONS'.

t_fcat_processed_ord-ref_table = 'VBAP'.

t_fcat_processed_ord-ref_field = 'KWMENG'.

t_fcat_processed_ord-coltext = 'Ordered Tons'(031).

t_fcat_processed_ord-seltext = 'Ordered Tons'(031).

t_fcat_processed_ord-no_zero = c_true.

APPEND t_fcat_processed_ord.

CLEAR t_fcat_processed_ord.

t_fcat_processed_ord-col_pos = 7.

t_fcat_processed_ord-fieldname = 'FIN_TONS'.

t_fcat_processed_ord-ref_table = 'MSKA'.

t_fcat_processed_ord-ref_field = 'KALAB'.

t_fcat_processed_ord-coltext = 'Finished Tons'(032).

t_fcat_processed_ord-seltext = 'Finished Tons'(032).

t_fcat_processed_ord-no_zero = c_true.

APPEND t_fcat_processed_ord.

CLEAR t_fcat_processed_ord.

t_fcat_processed_ord-col_pos = 8.

t_fcat_processed_ord-fieldname = 'FIN_DAYS'.

t_fcat_processed_ord-inttype = 'I'.

t_fcat_processed_ord-coltext = 'Finished Days'(033).

t_fcat_processed_ord-seltext = 'Finished Days'(033).

t_fcat_processed_ord-no_zero = c_true.

APPEND t_fcat_processed_ord.

CLEAR t_fcat_processed_ord.

t_fcat_processed_ord-col_pos = 9.

t_fcat_processed_ord-fieldname = 'REL_TONS'.

t_fcat_processed_ord-ref_table = 'LIKP'.

t_fcat_processed_ord-ref_field = 'BTGEW'.

t_fcat_processed_ord-coltext = 'Released Tons'(034).

t_fcat_processed_ord-seltext = 'Released Tons'(034).

t_fcat_processed_ord-no_zero = c_true.

APPEND t_fcat_processed_ord.

CLEAR t_fcat_processed_ord.

t_fcat_processed_ord-col_pos = 10.

t_fcat_processed_ord-fieldname = 'REL_DAYS'.

t_fcat_processed_ord-inttype = 'I'.

t_fcat_processed_ord-coltext = 'Released Days'(035).

t_fcat_processed_ord-seltext = 'Released Days'(035).

t_fcat_processed_ord-no_zero = c_true.

APPEND t_fcat_processed_ord.

CLEAR t_fcat_processed_ord.

t_fcat_processed_ord-col_pos = 11.

t_fcat_processed_ord-fieldname = 'STATUS'.

t_fcat_processed_ord-inttype = 'C'.

t_fcat_processed_ord-outputlen = 15.

t_fcat_processed_ord-coltext = 'Test/Bundling'(036).

t_fcat_processed_ord-seltext = 'Test/Bundling'(036).

t_fcat_processed_ord-scrtext_l = 'Test/Bundling'(036).

APPEND t_fcat_processed_ord.

CLEAR t_fcat_processed_ord.

t_fcat_processed_ord-col_pos = 12.

t_fcat_processed_ord-fieldname = 'TB_TONS'.

t_fcat_processed_ord-ref_table = 'ZLGCYINFO'.

t_fcat_processed_ord-ref_field = 'TONS'.

t_fcat_processed_ord-coltext = 'Test/Bundling Tons'(037).

t_fcat_processed_ord-seltext = 'Test/Bundling Tons'(037).

t_fcat_processed_ord-no_zero = c_true.

APPEND t_fcat_processed_ord.

CLEAR t_fcat_processed_ord.

t_fcat_processed_ord-col_pos = 13.

t_fcat_processed_ord-fieldname = 'NOTES3'.

t_fcat_processed_ord-ref_table = 'ZCSIMEMO'.

t_fcat_processed_ord-ref_field = 'TEXT'.

t_fcat_processed_ord-coltext = 'Notes'(024).

t_fcat_processed_ord-seltext = 'Notes'(024).

t_fcat_processed_ord-hotspot = c_true.

APPEND t_fcat_processed_ord.

ENDFORM. " FILL_FIELDCAT_PROCESSED_ORD

----


  • Module STATUS_0104 OUTPUT *

----


  • This module creates objects for Container & Grid to display *

  • Flagged Order Details *

----


MODULE status_0104 OUTPUT.

IF gv_cont_flagged_ord IS INITIAL.

CREATE OBJECT gv_cont_flagged_ord

EXPORTING

container_name = c_cont_flagged_ord.

CREATE OBJECT gv_grid_flagged_ord

EXPORTING

i_parent = gv_cont_flagged_ord.

  • Fill layout for FLGORD report

gs_lay_flagged_ord-zebra = c_true.

gs_lay_flagged_ord-grid_title = text-009.

gs_lay_flagged_ord-cwidth_opt = c_true.

gs_lay_flagged_ord-sel_mode = c_save.

  • Fill field caltalog for FLGORD report

PERFORM fill_fieldcat_flagged_ord.

  • Exclude Buttons From Toolbar

PERFORM fill_toolbar.

CALL METHOD gv_grid_flagged_ord->set_table_for_first_display

EXPORTING

is_variant = gs_var_flagged_ord

i_save = c_save

it_toolbar_excluding = t_exclude

is_layout = gs_lay_flagged_ord

CHANGING

it_outtab = t_flagged_ord[]

it_fieldcatalog = t_fcat_flagged_ord[].

CREATE OBJECT gv_event_receiver.

SET HANDLER gv_event_receiver->handle_hotspot

FOR gv_grid_flagged_ord.

SET HANDLER gv_event_receiver->handle_top_of_page

FOR gv_grid_flagged_ord.

*/ Begin of Modification - Request No. DV2K904687

SET HANDLER gv_event_receiver->handle_user_command

FOR gv_grid_flagged_ord.

SET HANDLER gv_event_receiver->handle_toolbar

FOR gv_grid_flagged_ord.

CALL METHOD gv_grid_flagged_ord->set_toolbar_interactive.

*/ End of Modification - Request No. DV2K904687

ELSE.

CALL METHOD gv_grid_flagged_ord->refresh_table_display.

ENDIF. " IF GV_CONT_FLAGGED_ORD IS ...

ENDMODULE. " STATUS_0104 OUTPUT

----


  • Form fill_fieldcat_flagged_ord *

----


  • This subroutine fills the Field Catalog for Flagged Order Details *

----


  • There are no parameters need to be passed to this subroutine *

----


FORM fill_fieldcat_flagged_ord.

CLEAR t_fcat_flagged_ord.

t_fcat_flagged_ord-col_pos = 1.

t_fcat_flagged_ord-fieldname = 'SORTL4'.

t_fcat_flagged_ord-ref_table = 'KNA1'.

t_fcat_flagged_ord-ref_field = 'SORTL'.

t_fcat_flagged_ord-coltext = 'CC'(016).

t_fcat_flagged_ord-seltext = 'Customer Code'(017).

t_fcat_flagged_ord-hotspot = c_true.

APPEND t_fcat_flagged_ord .

CLEAR t_fcat_flagged_ord.

t_fcat_flagged_ord-col_pos = 2.

t_fcat_flagged_ord-fieldname = 'IHREZ_E4'.

t_fcat_flagged_ord-ref_table = 'VBKD'.

t_fcat_flagged_ord-ref_field = 'IHREZ_E'.

t_fcat_flagged_ord-coltext = 'Mill Order'(018).

t_fcat_flagged_ord-seltext = 'Mill Order'(018).

t_fcat_flagged_ord-hotspot = c_true.

APPEND t_fcat_flagged_ord .

CLEAR t_fcat_flagged_ord.

t_fcat_flagged_ord-col_pos = 3.

t_fcat_flagged_ord-fieldname = 'SALORD4'.

t_fcat_flagged_ord-inttype = 'C'.

t_fcat_flagged_ord-outputlen = 17.

t_fcat_flagged_ord-coltext = 'SAP Order & Item'(019).

t_fcat_flagged_ord-seltext = 'SAP Order & Item'(019).

t_fcat_flagged_ord-scrtext_l = 'SAP Order & Item'(019).

t_fcat_flagged_ord-hotspot = c_true.

APPEND t_fcat_flagged_ord .

CLEAR t_fcat_flagged_ord.

t_fcat_flagged_ord-col_pos = 4.

t_fcat_flagged_ord-fieldname = 'DESCRI'.

t_fcat_flagged_ord-inttype = 'C'.

t_fcat_flagged_ord-outputlen = 70.

t_fcat_flagged_ord-coltext = 'Description'(020).

t_fcat_flagged_ord-seltext = 'Description'(020).

t_fcat_flagged_ord-scrtext_l = 'Description'(020).

APPEND t_fcat_flagged_ord .

CLEAR t_fcat_flagged_ord.

t_fcat_flagged_ord-col_pos = 5.

t_fcat_flagged_ord-fieldname = 'SPECI'.

t_fcat_flagged_ord-inttype = 'C'.

t_fcat_flagged_ord-outputlen = '30'.

t_fcat_flagged_ord-coltext = 'Specification'(021).

t_fcat_flagged_ord-seltext = 'Specification'(021).

t_fcat_flagged_ord-scrtext_l = 'Specification'(021).

APPEND t_fcat_flagged_ord .

CLEAR t_fcat_flagged_ord.

t_fcat_flagged_ord-col_pos = 6.

t_fcat_flagged_ord-fieldname = 'SALDATA'.

t_fcat_flagged_ord-ref_table = 'VBAP'.

t_fcat_flagged_ord-ref_field = 'ZZCUST_REQ_AVAIL'.

t_fcat_flagged_ord-coltext = 'Sales Data B'(025).

t_fcat_flagged_ord-seltext = 'Customer Requested Date'(026).

APPEND t_fcat_flagged_ord.

CLEAR t_fcat_flagged_ord.

t_fcat_flagged_ord-col_pos = 7.

t_fcat_flagged_ord-fieldname = 'UNIT'.

t_fcat_flagged_ord-ref_table = 'ZLGCYINFO'.

t_fcat_flagged_ord-ref_field = 'UNIT'.

t_fcat_flagged_ord-coltext = 'Unit'(029).

t_fcat_flagged_ord-seltext = 'Unit'(029).

APPEND t_fcat_flagged_ord .

CLEAR t_fcat_flagged_ord.

t_fcat_flagged_ord-col_pos = 8.

t_fcat_flagged_ord-fieldname = 'TONS'.

t_fcat_flagged_ord-ref_table = 'ZLGCYINFO'.

t_fcat_flagged_ord-ref_field = 'TONS'.

t_fcat_flagged_ord-coltext = 'Tons'(039).

t_fcat_flagged_ord-seltext = 'Tons'(039).

t_fcat_flagged_ord-no_zero = c_true.

APPEND t_fcat_flagged_ord .

CLEAR t_fcat_flagged_ord.

t_fcat_flagged_ord-col_pos = 9.

t_fcat_flagged_ord-fieldname = 'PRIORITY'.

t_fcat_flagged_ord-ref_table = 'VBAP'.

t_fcat_flagged_ord-ref_field = 'LPRIO'.

t_fcat_flagged_ord-coltext = 'Priority'(038).

t_fcat_flagged_ord-seltext = 'Priority'(038).

APPEND t_fcat_flagged_ord .

CLEAR t_fcat_flagged_ord.

t_fcat_flagged_ord-col_pos = 10.

t_fcat_flagged_ord-fieldname = 'NOTES4'.

t_fcat_flagged_ord-ref_table = 'ZCSIMEMO'.

t_fcat_flagged_ord-ref_field = 'TEXT'.

t_fcat_flagged_ord-coltext = 'Notes'(024).

t_fcat_flagged_ord-seltext = 'Notes'(024).

t_fcat_flagged_ord-hotspot = c_true.

APPEND t_fcat_flagged_ord.

ENDFORM. " FILL_FIELDCAT_FLAGGED_ORD

----


  • Form fill_toolbar *

----


  • This subroutine excludes buttons from toolbar *

----


  • There are no parameters to be passed to this subroutine *

----


FORM fill_toolbar.

CLEAR gs_exclude.

gs_exclude = cl_gui_alv_grid=>mc_fc_subtot.

APPEND gs_exclude TO t_exclude.

CLEAR gs_exclude.

gs_exclude = cl_gui_alv_grid=>mc_fc_graph.

APPEND gs_exclude TO t_exclude.

ENDFORM. " FILL_TOOLBAR

----


  • Form call_va03 *

----


  • This subroutine calls transaction VAO3 for selected Sales Order Line *

  • Item *

----


  • pv_salord --> Sales Order & Item *

----


FORM call_va03 USING pv_salord TYPE any.

CLEAR: gv_vbeln,

gv_posnr.

SPLIT pv_salord AT '-'

INTO gv_vbeln gv_posnr.

SET PARAMETER ID 'AUN' FIELD gv_vbeln.

CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.

ENDFORM. " CALL_VA03

----


  • Form call_zsd11_cust_code *

----


  • This subroutine call report ZSD11 for selected Customer Code *

----


  • pv_sortl--> customer search term *

----


FORM call_zsd11_cust_code USING pv_sortl TYPE kna1-sortl.

SUBMIT zsd00065

WITH custcode = pv_sortl

AND RETURN.

ENDFORM. " CALL_ZSD11_CUST_CODE

----


  • Form call_zsd11_millorder *

----


  • This subroutine calls report ZSD11 for selected Mill Order *

----


  • pv_ihrez_e --> Mill Order Number *

----


FORM call_zsd11_millorder USING pv_ihrez_e TYPE vbkd-ihrez_e.

SUBMIT zsd00065

WITH prefix EQ pv_ihrez_e+0(2)

WITH number EQ pv_ihrez_e+3(4)

WITH orditm EQ pv_ihrez_e+8(2)

AND RETURN.

ENDFORM. " CALL_ZSD11_MILLORDER

----


  • Form edit_notes *

----


  • This subroutine calls report ZSD00087 to get Notes for Sales Order *

  • Line Item *

----


  • pv_salord --> sales order & item *

----


FORM edit_notes USING pv_salord TYPE any.

CLEAR: gv_vbeln,

gv_posnr.

SPLIT pv_salord

AT '-'

INTO gv_vbeln

gv_posnr.

SUBMIT zsd00087

WITH vbeln EQ gv_vbeln

WITH posnr EQ gv_posnr

AND RETURN.

ENDFORM. " EDIT_NOTES

*/ Begin of Modification - Request No. DV2K904687

----


  • Form refresh_report_tables *

----


  • This subroutine clears the report output tables *

----


  • There are no parameters to be passed to this subroutine *

----


FORM refresh_report_tables .

CLEAR:

t_pre_prod_ord,

t_delinquent_ord,

t_processed_ord,

t_flagged_ord,

gv_flg.

REFRESH:

t_pre_prod_ord,

t_delinquent_ord,

t_processed_ord,

t_flagged_ord,

t_fcat_pre_prod_ord.

ENDFORM. " refresh_report_tables

*/ End of Modification - Request No. DV2K904687

----


  • Form refresh_tables *

----


  • This subroutines frees the internal tables from memory *

----


  • There are no parameters to need be passed to this subroutine *

----


FORM refresh_tables.

CLEAR:

t_common_data,

t_customer_code,

t_csi_memo_data,

t_schedule_line_date,

t_configuration,

t_stock,

t_delivery_data,

t_released_tons_days.

REFRESH:

t_common_data,

t_customer_code,

t_csi_memo_data,

t_schedule_line_date,

t_configuration,

t_stock,

t_delivery_data,

t_released_tons_days.

ENDFORM. " REFRESH_TABLES

*/ Begin of Modification - Request No. DV2K904687

----


  • Form CHANGE_DEL_PRIORITY *

----


  • This subroutine changes the Delivery Priority of the Sales Order *

  • by using BAPI call method. *

----


  • There are no parameters to need be passed to this subroutine *

----


FORM change_del_priority .

DATA:

ls_so_head_inx TYPE bapisdh1x,

t_so_item_in TYPE STANDARD TABLE OF bapisditm WITH HEADER LINE,

t_so_item_inx TYPE STANDARD TABLE OF bapisditmx WITH HEADER LINE,

t_return1 TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE,

ls_return2 TYPE bapiret2.

IF p_sonum IS INITIAL OR s_item[] IS INITIAL.

MESSAGE e001 WITH 'Enter both Sales Order and Item Number'(045).

ENDIF. " IF p_sonum IS INITIAL OR ...

SELECT posnr " Sales Order Item Number

FROM vbap " Sales Document: Item data

INTO TABLE t_so_item_in

WHERE vbeln EQ p_sonum

AND posnr IN s_item.

IF sy-subrc NE 0.

MESSAGE e001 WITH text-001. " No data found

ENDIF. " IF sy-subrc NE 0

ls_so_head_inx-updateflag = 'U'.

  • Populating Item data for BAPI

LOOP AT t_so_item_in.

t_so_item_in-dlv_prio = p_delpr.

MODIFY t_so_item_in.

t_so_item_inx-itm_number = t_so_item_in-itm_number.

t_so_item_inx-updateflag = 'U'.

t_so_item_inx-dlv_prio = 'X'.

APPEND t_so_item_inx.

CLEAR t_so_item_inx.

ENDLOOP. " LOOP AT t_so_item_in

  • Update Delivery Priority using BAPI method

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

salesdocument = p_sonum

order_header_inx = ls_so_head_inx

TABLES

return = t_return1[]

order_item_in = t_so_item_in[]

order_item_inx = t_so_item_inx[].

READ TABLE t_return1 WITH KEY type = 'E'.

IF sy-subrc NE 0.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

IMPORTING

return = ls_return2.

MESSAGE s001

WITH 'Sales Order Delivery Priority Changed Successfully'(046).

CLEAR gv_flg.

ELSE.

MESSAGE s001

WITH 'Error: Changing Sales Order Delivery Priority'(047).

ENDIF. " IF sy-subrc NE 0.

ENDFORM. " CHANGE_DEL_PRIORITY

*/ End of Modification - Request No. DV2K904687

0 Kudos

Hi Ivaylo,

oh yes I think I remember: The ABAP Classes have changed a little. If I remember it correctly, in FORM getfields the CASE lr_typedescr->kind will not work, the previous name was type_kind and the constants 'S' and 'T' were different. I hope that was 4.6 and not 4.7; you may try to find out.

The rest I am not sure but quite convinced..

Regards,

Clemens

0 Kudos

Hi,

finaly I think I got the behaviour I need. For all who are still interested:

1. In order to set default setting for each different grid-control - the proper call is:

CALL METHOD my_grid1->set_table_for_first_display

EXPORTING

is_variant = wa_variant1

is_layout = gwa_layout

i_save = 'A'

  • i_default = ' ' <=== don't pass anything

CHANGING it_outtab = cpt_stat

it_fieldcatalog = gt_fieldcat.

2. Proper setting for wa_variant1 is to set (some) handle for each grid - this ensure displaying and managing only the variants created in the context of a particular grid, but not all of the variants per report.

Many thanks to Charles Folwell who points me to the right direction.

Sample, provided by Clemens Li (thanks a lot, Clemens!), IMHO is pretty general - means the form is supposed to be called from lot of points in the program (or from many programs) and the source data definition is not determined until runtime.

Clemens, just to clarify:

1. TRY..ENDTRY is syntax in use for versions above 4.7 (including).

2. The class cl_rsmds_hash_utilities is missing for versions 4.6..4.7, I found it in one of our IDes systems (ECC-6), and was able to check class-method called in your example.

3. In versions below 4.7 (including) the correct instance-attribute name for cl_abap_typedescr is: "my_typedescr->type_kind", but I didn't investigated possible values of the attribute.

Thanks to all who collaborated in this thread, some of you helped me a lot to reach the behaviour I needed.

Regards,

Ivaylo Mutafchiev