Escolar Documentos
Profissional Documentos
Cultura Documentos
At present, the only methodology available to make the configuration is the manual
approach via SPRO configurations. Many have tried to implement an automated
methodology for mass uploading of the release codes and strategies, but to no avail
as there seemed to be no BAPI or Function Module available for the same. The only
automated approach presently available, even online, is an LSMW approach. The
main drawback of this LSMW approach is that it is specific to a particular project or
method of configuration as it is based on the screen recordings. Hence it cannot be
used like a generic tool.
This paper aims to give you a brief overview of a Function Module approach to
achieve the desired result of uploading the Release Codes and Strategies from an
input file in to the configuration tables. The below explanation and code snippets
provided is not a complete end-to-end approach. However, it can be extended to
suit the desired results.
BENEFICIARIES:
SYSTEM USED:
1. Excel File which contains the input data in the desired format. There will be two
separate input files for each of the below:
Release Codes
Release Strategies
STEPS TO BE PERFORMED:
A) ZCL_RELSTRAT_TOOL
For creating a simple tool for the desired result of mass upload of Release Strategy
and Release Codes, I have created a class called ZCL_RELSTRAT_TOOL which
contains all the methods used in the program. A few of the important methods used
in this class are listed below and are also explained further in the paper.
B) Release Codes
Let us first discuss on how to upload the release codes. Assuming that the Release Codes
are uploaded via an Excel file in the below format:
Create an internal type GTY_RELCODE with the below fields:
This type is used to create the internal table GT_RELCODE which will store the values
for the release codes read from the input file.
In this scenario, use the function module ‘TEXT_CONVERT_XLS_TO_SAP‘ to read the file
into the internal table, as seen below:
For uploading the release codes, we need to use the view ‘VV_T16FC_2′, as seen below.
The main function module used to uploading the Release Codes is ‘VIEWPROC_V_T16FC‘.
Kindly make a note of the parameters being passed to it, as seen below. This code is to
be written inside the above method of the class.
In the above function module, the values of DBA_SELLIST (Selection Criteria for DB
access), DPL_SELLIST (Selection criteria for displaying), X_HEADER (Control block table
for the view) and X_NAMTAB (Control block table for the view fields) parameters need
to be fetched specially from the DDIC. These values can be obtained by using the
function module ‘VIEW_GET_DDIC_INFO‘.
For the function module ‘VIEWPROC_V_T16FC‘, it needs two more parameters,
EXTRACT and TOTAL which are populated as below:
For testing the above logic, below screenshot shows the existing release codes
configured in the system.
Rechecking the SPRO configuration, we can see the new entries made and also the
same made in T16FC and T16FD tables.
SPRO path:
Materials Management -> Purchasing -> Purchase Order -> Release Procedure for
Purchase Orders -> Define Release Procedure for Purchase Orders
B) Release Strategies
Let us now discuss on how to upload the release strategies. Assuming that the
Release Strategies are uploaded via an Excel file in the below format:
This type is used to create the internal table GT_RELSTRAT which will store the values
for the release codes read from the input file.
In this scenario, use the function module ‘TEXT_CONVERT_XLS_TO_SAP‘ to read the file
into the internal table, as seen below:
Before uploading the Release Strategies, we first need to upload the Release Strategy
Pre-Requisites, which gets updated into T16FV table, for which we can call the below
class method.
The below codes are to be written inside the above method of the class.
Looping through the entries of GT_T16FV, if the UPDKZ field is ‘I’, do a direct insert into
T16FV table. For updating T16FV, even SAP does a direct insert as per the standard
program.
If the insert is successful, populate the entries of GT_E071K table also so that it updates
the transport table E071K as well as populate GT_KO200 table so that it updates KO200
(Interface Structures for Objects in CTS) table.
Once the Release Strategy Pre-Requisites are uploaded, the next step is to upload the
Release Strategy Statuses, which gets updated into the T16FK table, for which we call
the below method of the class.
This code is to be written inside the above method of the class. Declare an internal table
GT_T16FK which is of the type GTY_T16FK which is as below:
If a Release Strategy has ‘n’ Release Codes, then ‘n+1’ entries are maintained in the
T16FK table with all entries having the Release Indicator (FRGKX) field as ‘2’ and
the last record having value as ‘1’. Also, the UPDKZ field is populated as ‘I’ as it is a
new entry.
So, an appropriate logic needs to be framed for the same to populate the values in
the GT_T16FK table. The below code snippet is only a part of the complete logic as
the focus is only on the concept.
First, loop through GT_RELSTRAT and find out how many release codes are present.
This is maintained in a counter LCNT_CODE which is incremented for each release
code.
Looping through the entries of GT_T16FK, if the UPDKZ field is ‘I’, do a direct insert
into T16FK table. For updating T16FK, even SAP does a direct insert as per the
standard program.
If the insert is successful, populate the entries of GT_E071K table also so that it
updates the transport table E071K as well as populate GT_KO200 table so that it
updates KO200 (Interface Structures for Objects in CTS) table.
Once the Pre-Requisites and Statuses are uploaded, we can use the function
module‘TR_OBJECTS_INSERT‘ to lock the both the tables in the transport by passing
the GT_E071K and GT_KO200 tables, as seen below:
For uploading the release strategies, we need to use the view ‘VV_T16FS_2’, as seen
below.
This code is to be written inside the above method of the class. The main function
module used to uploading the Release Strategies is ‘VIEWPROC_V_T16FS‘. Kindly
make a note of the parameters being passed to it, as seen below.
In the above function module, the values of DBA_SELLIST (Selection Criteria for DB
access), DPL_SELLIST (Selection criteria for displaying), X_HEADER (Control block
table for the view) and X_NAMTAB (Control block table for the view fields)
parameters need to be fetched specially from the DDIC. These values can be
obtained by using the function module ‘VIEW_GET_DDIC_INFO‘.
SPRO path:
Materials Management -> Purchasing -> Purchase Order -> Release Procedure for
Purchase Orders -> Define Release Procedure for Purchase Orders