创建parameter id

时间:2023-03-09 07:32:22
创建parameter id

Custom Parameter-id Creation

By Abhijit Daptary, Capgemini India

Step1: Creation of parameter ID. 

Parameter ID can be created in the table TPARA. Just enter the name of the parameter id in the table and that parameter ID will be created. 

创建parameter id

 
 

Go to the table maintenance generator of the table TPARA and go to the Maintain button through the transaction SM30. 

Enter the table view name TPARA. 

创建parameter id

 
 

Click on the maintain button. The following information will appear. Click on the Tick button or the ENTER button to go to the next screen. 

创建parameter id

 
 

Enter the Set/Get parameter id as the parameter ID you want to create. Here, I will be creating the parameter Id as ZNAME_DATA1. Click on ENTER button. 

创建parameter id

 
 

It will ask for the text of the parameter Id. Enter the text of the parameter ID and click on the Savebutton. 

创建parameter id

 
 

创建parameter id

 
 

Enter the Package and the transport number. 

The parameter id can be seen in the table TPARA

创建parameter id

 
 

Step2: Using the parameter Id that you have created. 

Now go to the SE11 transaction for creating a data element and enter the parameter id at theFurther Characteristics tab at the parameter Id section. 

创建parameter id

 
 

Activate the data element and use it with the program. It will act the same good as a standard one.

 
 

来自 <http://saptechnical.com/Tutorials/ABAP/ParameterID/custom.htm>

 
 

 
 

标准程序的Parameter id 并不一定准确

2014年12月30日

10:36

Exp.

 
 

Me39

F1 看到的是VRT

创建parameter id

 
 

 
 

程序中:

根据不同的配置 id可能各不相同

MODULE d0205_get_parameter OUTPUT.

 
 

  DATA: gv_cc_flag TYPE c LENGTH 1.

 
 

* Belegnummer über Parameter-Id nur holen, wenn noch nicht anderweitig

* vorbelegt ist (z.B. in ME38-Aufruf aus ME57)

  CHECK rm06e-evrtn EQ space.                               "4.0B TK

  CASE t160-bstyp.

    WHEN bstyp-kont.

      GET PARAMETER ID 'CTR' FIELD rm06e-evrtn.

      GET PARAMETER ID 'CCNN' FIELD gv_cc_flag.

      IF gv_cc_flag IS NOT INITIAL.

        GET PARAMETER ID 'CCTR' FIELD rm06e-evrtn.          "CCM EhP4

        CLEAR gv_cc_flag.

        SET PARAMETER ID 'CCNN' FIELD gv_cc_flag.

      ENDIF.

    WHEN bstyp-lfpl.

      GET PARAMETER ID 'SAG' FIELD rm06e-evrtn.

    WHEN space.

      GET PARAMETER ID 'VRT' FIELD rm06e-evrtn.

  ENDCASE.

 
 

ENDMODULE.                 " D0205_GET_PARAMETER  OUTPUT

 
 

一个字段可能出现在多个场合

但是定义是不一样的

 
 

sap的标准程序可能都是用一个字段(同一个dataelemnt)

然后技术信息里面看到的parameter id 并不是程序中实际对应的id

导致跨程序调用传值失败