SlideShare a Scribd company logo
1 of 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.

More Related Content

Viewers also liked

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
 

Viewers also liked (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
 

Similar to Zmd Constant

Similar to 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
 

More from 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
 

More from 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
 

Recently uploaded

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
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
 
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
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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
 
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...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

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.