SlideShare une entreprise Scribd logo
1  sur  4
ZMD_CONSTANT and ZHEADING examples




ZMD_Constant table – If I had to do it again – ZSUBROUTINE should be removed, and
zprogram should be name.
ZMD_CONSTANT and ZHEADING examples


Here’s a select statement with constants


 select matnr matkl into table i_mara
 from mara
   where matnr in s_matnr and
       ( matkl = ‘80’ or
         Matkl = ‘80S’ )

Here’s the ZMD_CONSTANT entry:




This is a sample program using ZMD_CONSTANT and ZHEADING. The ZHEADING
code will follow. ZHEADING is the standard heading we use on all reports.
REPORT ZMCSIMPLE no standard page heading.
tables: mara,
     zmd_constant.

data: i_zmd_constant type standard table of zmd_constant,
    w_zmd_constant type zmd_constant.

types: begin of t_matkl,
    sign type zmd_constant-zsign,
    option type zmd_constant-zoption,
    low type zmd_constant-field_low,
    high type zmd_constant-field_high,
    end of t_matkl.

data: i_pdt type standard table of t_matkl,
    w_pdt type t_matkl.

types: begin of t_mara,
    matnr type mara-matnr,
    matkl type mara-matkl,
    end of t_mara.

data: i_mara type standard table of t_mara,
    w_mara type t_mara.

data: w_matnr type mara-matnr.

constants: c_pdt(3) value 'PDT'.

SELECT-OPTIONS: s_matnr for mara-matnr.

START-OF-SELECTION.
 perform load_constant.
*** Show Limit of select by range
 select matnr matkl into table i_mara
 from mara
   where matnr in s_matnr and
ZMD_CONSTANT and ZHEADING examples

        matkl in i_pdt.
 if sy-subrc <> 0.
   write: / 'No records found for selection'.
 endif.

 loop at i_mara into w_mara.
  write: / w_mara-matnr,
        w_mara-matkl.
 endloop.

END-OF-SELECTION.

TOP-OF-PAGE.
 INCLUDE zheading.
 uline.
 perform write_selections.
 write: /.

*---------------------------------------------------------------------*
*     FORM load_constant                                       *
*---------------------------------------------------------------------*
form load_constant.
*** Select statement to pull data from zmd_constant
  SELECT         *
    FROM          zmd_constant
    INTO TABLE i_zmd_constant
    WHERE          zprogram = c_pdt.

 IF sy-subrc <> 0.
  WRITE: text-001.
 ENDIF.

*Puts results of the select statement above into usable format
 LOOP AT i_zmd_constant INTO w_zmd_constant.
  CASE w_zmd_constant-zstatement.
   WHEN c_pdt.
    w_pdt-sign        = w_zmd_constant-zsign.
    w_pdt-option = w_zmd_constant-zoption.
    w_pdt-low          = w_zmd_constant-field_low.
    w_pdt-high        = w_zmd_constant-field_high.

    APPEND w_pdt to i_pdt.
  endcase.
 endloop.

endform.
*---------------------------------------------------------------------*
*     FORM write_selections                                    *
*---------------------------------------------------------------------*
form write_selections.
  write: 'Material:'.
  loop at s_matnr..
   write: / s_matnr-low.
  endloop.



ZHEADING is an include program. This is the ZHEADING code:
data: gv_system_INC(8) type c.
data: gv_position_INC type i.
DATA: GV_PAGNO_INC(6) TYPE C.                                 quot;DEVK930068
data: w_report_syst(46) type c.                         quot;DEVK934952
ZMD_CONSTANT and ZHEADING examples


ULINE.

*** FORMAT PERRIGO COMPANY LINE
concatenate syst-sysid syst-mandt
            into gv_system_INC separated by '/'.
concatenate syst-repid gv_system_inc into w_report_syst
              separated by ' '.          quot;DEVK934952
*rite: / syst-repid, gv_system_INC. quot;DEVK934952
write: / w_report_syst.                       quot;DEVK934952

* POS=(LINE SZ - BOTH SIDES SPACE - TITLE LNGTH) / 2 + LEFT SIDE SPACE
gv_position_INC = ( sy-linsz - 36 - 15 ) / 2 + 17.
write: at gv_position_INC(15) 'Perrigo Company'.

* POSITION = LINE SIZE - SPACE NEEDED TO RIGHT
gv_position_INC = sy-linsz - 19.
write: at gv_position_INC syst-datum, syst-uzeit.

*** FORMAT TITLE LINE
WRITE: / SYST-UNAME.

*gv_position_INC = strlen( syst-title(60) ).         quot;devk939430
gv_position_INC = strlen( syst-title(70) ).         quot;devk939430
* POS = (LINE SZ - BOTH SIDES SPACE - TITLE LNGTH) / 2 + LEFT SIDE SPACE
gv_position_INC = ( sy-linsz - 17 - gv_position_INC ) / 2 + 8.
*write: at gv_position_INC(60) syst-title.          quot;devk939430
write: at gv_position_INC(70) syst-title.          quot;devk939430

* POS = LINE SIZE - SPACE NEEDED TO RIGHT
GV_POSITION_INC = SY-LINSZ - 12.                    quot;DEVK930068
gv_pagno_INC = syst-pagno.
write: at gv_position_inc 'Page:', gv_pagno_INC.

Contenu connexe

En vedette

World 2.0: Working in a 2.0 World
World 2.0: Working in a 2.0 WorldWorld 2.0: Working in a 2.0 World
World 2.0: Working in a 2.0 WorldDavid Gurteen
 
Milestone One Presentation
Milestone One PresentationMilestone One Presentation
Milestone One Presentationjordan.eyres
 
Voice Mashups: Telephony power without telephony expertise
Voice Mashups:  Telephony power without telephony expertiseVoice Mashups:  Telephony power without telephony expertise
Voice Mashups: Telephony power without telephony expertiseVoodooLabs
 
INFORMATICA
INFORMATICAINFORMATICA
INFORMATICACRAYOLAS
 
Conciertode Viena
Conciertode VienaConciertode Viena
Conciertode Vienaguest12766c
 
O S Do Nosso Brasil
O S Do Nosso BrasilO S Do Nosso Brasil
O S Do Nosso Brasilguest07abb3
 
Introd Período Pre Wegener
Introd Período Pre WegenerIntrod Período Pre Wegener
Introd Período Pre Wegenerana mendes
 
Karina Daniela Casiano Ordaz
Karina Daniela Casiano OrdazKarina Daniela Casiano Ordaz
Karina Daniela Casiano Ordazkarinaemo2295
 
Chapter 2 French III Vocab
Chapter 2 French III VocabChapter 2 French III Vocab
Chapter 2 French III VocabMatt Montagne
 
Aspectes TeòRics En Coeducació Power
Aspectes TeòRics En Coeducació PowerAspectes TeòRics En Coeducació Power
Aspectes TeòRics En Coeducació Powerguest45260f
 
Scsu91908006
Scsu91908006Scsu91908006
Scsu91908006SAPHOTO
 
Logo Feira Do Livro Unisinos
Logo Feira Do Livro UnisinosLogo Feira Do Livro Unisinos
Logo Feira Do Livro UnisinosPortfoliopp
 
Unit Test1 Review
Unit Test1 ReviewUnit Test1 Review
Unit Test1 Reviewguest0b0f8d
 

En vedette (17)

Datasheet
DatasheetDatasheet
Datasheet
 
Vejez Gq
Vejez GqVejez Gq
Vejez Gq
 
World 2.0: Working in a 2.0 World
World 2.0: Working in a 2.0 WorldWorld 2.0: Working in a 2.0 World
World 2.0: Working in a 2.0 World
 
Milestone One Presentation
Milestone One PresentationMilestone One Presentation
Milestone One Presentation
 
Voice Mashups: Telephony power without telephony expertise
Voice Mashups:  Telephony power without telephony expertiseVoice Mashups:  Telephony power without telephony expertise
Voice Mashups: Telephony power without telephony expertise
 
INFORMATICA
INFORMATICAINFORMATICA
INFORMATICA
 
Conciertode Viena
Conciertode VienaConciertode Viena
Conciertode Viena
 
O S Do Nosso Brasil
O S Do Nosso BrasilO S Do Nosso Brasil
O S Do Nosso Brasil
 
Introd Período Pre Wegener
Introd Período Pre WegenerIntrod Período Pre Wegener
Introd Período Pre Wegener
 
Karina Daniela Casiano Ordaz
Karina Daniela Casiano OrdazKarina Daniela Casiano Ordaz
Karina Daniela Casiano Ordaz
 
Chapter 2 French III Vocab
Chapter 2 French III VocabChapter 2 French III Vocab
Chapter 2 French III Vocab
 
Eilat Israel
Eilat IsraelEilat Israel
Eilat Israel
 
Aspectes TeòRics En Coeducació Power
Aspectes TeòRics En Coeducació PowerAspectes TeòRics En Coeducació Power
Aspectes TeòRics En Coeducació Power
 
Scsu91908006
Scsu91908006Scsu91908006
Scsu91908006
 
Logo Feira Do Livro Unisinos
Logo Feira Do Livro UnisinosLogo Feira Do Livro Unisinos
Logo Feira Do Livro Unisinos
 
audasity
audasityaudasity
audasity
 
Unit Test1 Review
Unit Test1 ReviewUnit Test1 Review
Unit Test1 Review
 

Similaire à Zmd Constant

Similaire à Zmd Constant (20)

Alv Block
Alv BlockAlv Block
Alv Block
 
LLVM Backend の紹介
LLVM Backend の紹介LLVM Backend の紹介
LLVM Backend の紹介
 
ZFINDALLZPROGAM
ZFINDALLZPROGAMZFINDALLZPROGAM
ZFINDALLZPROGAM
 
Alvedit programs
Alvedit programsAlvedit programs
Alvedit programs
 
Alv barra her
Alv barra herAlv barra her
Alv barra her
 
Report zalv
Report  zalvReport  zalv
Report zalv
 
Module Prog
Module ProgModule Prog
Module Prog
 
Plsql examples
Plsql examplesPlsql examples
Plsql examples
 
12c Mini Lesson - Inline PLSQL from SQL
12c Mini Lesson - Inline PLSQL from SQL12c Mini Lesson - Inline PLSQL from SQL
12c Mini Lesson - Inline PLSQL from SQL
 
sas aeroplan sample
sas aeroplan samplesas aeroplan sample
sas aeroplan sample
 
Alv a otro alv
Alv a otro alvAlv a otro alv
Alv a otro alv
 
Network Automation: Ansible 102
Network Automation: Ansible 102Network Automation: Ansible 102
Network Automation: Ansible 102
 
Alv grid
Alv gridAlv grid
Alv grid
 
Call session Method of BDC
Call session Method of BDCCall session Method of BDC
Call session Method of BDC
 
Program For Parsing2
Program For Parsing2Program For Parsing2
Program For Parsing2
 
Template
TemplateTemplate
Template
 
Open SQL & Internal Table
Open SQL & Internal TableOpen SQL & Internal Table
Open SQL & Internal Table
 
03 abap3-090715081232-phpapp01-100511101016-phpapp02
03 abap3-090715081232-phpapp01-100511101016-phpapp0203 abap3-090715081232-phpapp01-100511101016-phpapp02
03 abap3-090715081232-phpapp01-100511101016-phpapp02
 
03 abap3-090715081232-phpapp01
03 abap3-090715081232-phpapp0103 abap3-090715081232-phpapp01
03 abap3-090715081232-phpapp01
 
Tool sdl2pml
Tool sdl2pmlTool sdl2pml
Tool sdl2pml
 

Plus de Michelle Crapo

Learning & using new technology
Learning & using new technologyLearning & using new technology
Learning & using new technologyMichelle Crapo
 
Learning & using new technology
Learning & using new technologyLearning & using new technology
Learning & using new technologyMichelle Crapo
 
Https _sapmats-de.sap-ag.de_download_download
Https  _sapmats-de.sap-ag.de_download_downloadHttps  _sapmats-de.sap-ag.de_download_download
Https _sapmats-de.sap-ag.de_download_downloadMichelle Crapo
 
2011 sap inside_track_eim_overview
2011 sap inside_track_eim_overview2011 sap inside_track_eim_overview
2011 sap inside_track_eim_overviewMichelle Crapo
 
SAP Technology QUICK overview
SAP Technology QUICK overviewSAP Technology QUICK overview
SAP Technology QUICK overviewMichelle Crapo
 
General Discussion Abap Tips
General Discussion   Abap  TipsGeneral Discussion   Abap  Tips
General Discussion Abap TipsMichelle Crapo
 

Plus de Michelle Crapo (14)

Abap objects
Abap objectsAbap objects
Abap objects
 
Abap objects
Abap objectsAbap objects
Abap objects
 
Learning & using new technology
Learning & using new technologyLearning & using new technology
Learning & using new technology
 
Learning & using new technology
Learning & using new technologyLearning & using new technology
Learning & using new technology
 
Dirty upgrade bala
Dirty upgrade balaDirty upgrade bala
Dirty upgrade bala
 
Big data mgmt bala
Big data mgmt balaBig data mgmt bala
Big data mgmt bala
 
Https _sapmats-de.sap-ag.de_download_download
Https  _sapmats-de.sap-ag.de_download_downloadHttps  _sapmats-de.sap-ag.de_download_download
Https _sapmats-de.sap-ag.de_download_download
 
2011 sap inside_track_eim_overview
2011 sap inside_track_eim_overview2011 sap inside_track_eim_overview
2011 sap inside_track_eim_overview
 
SAP OSS note search
SAP OSS note searchSAP OSS note search
SAP OSS note search
 
2007 SAPTech Ed
2007 SAPTech Ed2007 SAPTech Ed
2007 SAPTech Ed
 
SAP Technology QUICK overview
SAP Technology QUICK overviewSAP Technology QUICK overview
SAP Technology QUICK overview
 
General Discussion Abap Tips
General Discussion   Abap  TipsGeneral Discussion   Abap  Tips
General Discussion Abap Tips
 
Change Documents2
Change Documents2Change Documents2
Change Documents2
 
Alv Grids
Alv GridsAlv Grids
Alv Grids
 

Dernier

A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 

Dernier (20)

A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Zmd Constant

  • 1. ZMD_CONSTANT and ZHEADING examples ZMD_Constant table – If I had to do it again – ZSUBROUTINE should be removed, and zprogram should be name.
  • 2. ZMD_CONSTANT and ZHEADING examples Here’s a select statement with constants select matnr matkl into table i_mara from mara where matnr in s_matnr and ( matkl = ‘80’ or Matkl = ‘80S’ ) Here’s the ZMD_CONSTANT entry: This is a sample program using ZMD_CONSTANT and ZHEADING. The ZHEADING code will follow. ZHEADING is the standard heading we use on all reports. REPORT ZMCSIMPLE no standard page heading. tables: mara, zmd_constant. data: i_zmd_constant type standard table of zmd_constant, w_zmd_constant type zmd_constant. types: begin of t_matkl, sign type zmd_constant-zsign, option type zmd_constant-zoption, low type zmd_constant-field_low, high type zmd_constant-field_high, end of t_matkl. data: i_pdt type standard table of t_matkl, w_pdt type t_matkl. types: begin of t_mara, matnr type mara-matnr, matkl type mara-matkl, end of t_mara. data: i_mara type standard table of t_mara, w_mara type t_mara. data: w_matnr type mara-matnr. constants: c_pdt(3) value 'PDT'. SELECT-OPTIONS: s_matnr for mara-matnr. START-OF-SELECTION. perform load_constant. *** Show Limit of select by range select matnr matkl into table i_mara from mara where matnr in s_matnr and
  • 3. ZMD_CONSTANT and ZHEADING examples matkl in i_pdt. if sy-subrc <> 0. write: / 'No records found for selection'. endif. loop at i_mara into w_mara. write: / w_mara-matnr, w_mara-matkl. endloop. END-OF-SELECTION. TOP-OF-PAGE. INCLUDE zheading. uline. perform write_selections. write: /. *---------------------------------------------------------------------* * FORM load_constant * *---------------------------------------------------------------------* form load_constant. *** Select statement to pull data from zmd_constant SELECT * FROM zmd_constant INTO TABLE i_zmd_constant WHERE zprogram = c_pdt. IF sy-subrc <> 0. WRITE: text-001. ENDIF. *Puts results of the select statement above into usable format LOOP AT i_zmd_constant INTO w_zmd_constant. CASE w_zmd_constant-zstatement. WHEN c_pdt. w_pdt-sign = w_zmd_constant-zsign. w_pdt-option = w_zmd_constant-zoption. w_pdt-low = w_zmd_constant-field_low. w_pdt-high = w_zmd_constant-field_high. APPEND w_pdt to i_pdt. endcase. endloop. endform. *---------------------------------------------------------------------* * FORM write_selections * *---------------------------------------------------------------------* form write_selections. write: 'Material:'. loop at s_matnr.. write: / s_matnr-low. endloop. ZHEADING is an include program. This is the ZHEADING code: data: gv_system_INC(8) type c. data: gv_position_INC type i. DATA: GV_PAGNO_INC(6) TYPE C. quot;DEVK930068 data: w_report_syst(46) type c. quot;DEVK934952
  • 4. ZMD_CONSTANT and ZHEADING examples ULINE. *** FORMAT PERRIGO COMPANY LINE concatenate syst-sysid syst-mandt into gv_system_INC separated by '/'. concatenate syst-repid gv_system_inc into w_report_syst separated by ' '. quot;DEVK934952 *rite: / syst-repid, gv_system_INC. quot;DEVK934952 write: / w_report_syst. quot;DEVK934952 * POS=(LINE SZ - BOTH SIDES SPACE - TITLE LNGTH) / 2 + LEFT SIDE SPACE gv_position_INC = ( sy-linsz - 36 - 15 ) / 2 + 17. write: at gv_position_INC(15) 'Perrigo Company'. * POSITION = LINE SIZE - SPACE NEEDED TO RIGHT gv_position_INC = sy-linsz - 19. write: at gv_position_INC syst-datum, syst-uzeit. *** FORMAT TITLE LINE WRITE: / SYST-UNAME. *gv_position_INC = strlen( syst-title(60) ). quot;devk939430 gv_position_INC = strlen( syst-title(70) ). quot;devk939430 * POS = (LINE SZ - BOTH SIDES SPACE - TITLE LNGTH) / 2 + LEFT SIDE SPACE gv_position_INC = ( sy-linsz - 17 - gv_position_INC ) / 2 + 8. *write: at gv_position_INC(60) syst-title. quot;devk939430 write: at gv_position_INC(70) syst-title. quot;devk939430 * POS = LINE SIZE - SPACE NEEDED TO RIGHT GV_POSITION_INC = SY-LINSZ - 12. quot;DEVK930068 gv_pagno_INC = syst-pagno. write: at gv_position_inc 'Page:', gv_pagno_INC.