IWC.GetAppCGIValue: Importing a WebFOCUS Parameter or Variable

How to:

The IWC.GetAppCGIValue function imports the value of a WebFOCUS parameter or variable into a Maintain Data variable. IWC.GetAppCGIValue returns a value from the HTTP request header if the name of the variable or parameter is passed. If the name is not found, the function returns a null value. Therefore, you can check for errors by looking for a null value, then handle the error as needed.

Note: Unlike Maintain variables, WebFOCUS parameters and variables are case-sensitive.

Syntax: How to Import a WebFOCUS Parameter

Declare mnt_var/type_length = IWC.GetAppCGIValue(parm);

where:

mnt_var

Is the Maintain Data variable that receives the ASCII return value of the WebFOCUS parameter or variable. The value should be unescaped before being passed to the Maintain variable.

type_length

Is the selected type and length of the Maintain Data variable.

parm

Is the WebFOCUS parameter or variable to import. This value is case-sensitive, and must be alphanumeric.

Example: Importing a WebFOCUS Parameter

IWC.getAppCGIValue imports the WebFOCUS parameter PRODUCT_ID to Maintain Data:

Maintain File GGPRODS
Infer Product_ID into prodstk;
Declare pcode/a4=IWC.getAppCGIValue("PRODUCT_ID");
For 1 next Product_ID into prodstk where Product_ID eq pcode;