Author Archive fjourneau

Dropdown list in selection-screen

Sample code :


  PARAMETERS : p_field TYPE ztype AS LISTBOX VISIBLE LENGTH 25.
* If the  ZTYPE has a domain with values, values will be autmatically
* displayed.

If your type has no values in domain or if you want to change the dropdown list values use FM VRM_SET_VALUES in initialization:

Read More

Get SAP access keys (SCCR keys)

Sometimes you need to edit standard object.
When you implement notes for instance, you may have to edit standard object by doing manual actions.

To do that, an access key is required.

To get an access key, you need to have a S-USER linked to your SAP installation to access the SAP portal applications.

Read More

Hide a subform according to context node value

To hide a subform using javascript according a context node value in Adobe form :


// data.MAIN.SUBFORM_TO_HIDE::ready:form - (JavaScript, client)
var fieldToCheck= xfa.resolveNode("$record.MAIN.FIELD_VALUE");
if(fieldToCheck.value == null || fieldToCheck.value == "") {
    this.presence = "hidden";
}

Print form in Duplex

Spool, SAP-Script, Smartforms

Check this post : https://wiki.scn.sap.com/wiki/display/ABAP/Print+Duplex+from+SAP

Adobe form

The duplex printing of the adobe PDF forms can be achieved by setting the parameter available on Master Page of Adobe PDF.
This option is available in Adobe Live Cycle Designer 8.0 version.
The option is in the object view of the master page.

Read More

ABAP code to get change document infos

As it is not possible to do joins with cluster table, this is the code to get change documents data merged between tables CDHDR and CDPOS.

The goal is to get an internal table like :

Read More

Adobe form, count number of elements in a subform with JS

The goal here is to define of there are data into the table, if not, we hide the subform. That means, we hide the whole table (border and header line).
There are several ways to proceed, this is one :

Table from context is binded like :

  • TABLE_TEXT_HEADER_PO binded with $.TABLE_HEADER
  • LINE_TEXT_HEADER_PO binded with $.DATA[*] (repeat subform for each data item is ticked)
  • HEADER_PO_TEXT binded with $.TEXT_CONTENT
Read More

Get function name from form name

Use FM : FP_FUNCTION_MODULE_NAME.


CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
  EXPORTING
    i_name = lv_form  " form name
  IMPORTING
    e_funcname = lv_fm_name. " Function module name

FM to generate Planned Independent Requirement (PIR)

Planned Independent Requirement (PIR) are managed through transaction MD6x.
(Do not confuse with Purchase infos records 😉)

FM to manage PIR with ABAP are :

  • BAPI_REQUIREMENTS_CREATE
  • BAPI_REQUIREMENTS_CHANGE
Read More

Convert time unit into seconds

The goal is to convert whatever time unit declared on system into hour in ABAP.
One way to proceed is to check table T006.
Filter dimension (DIMID) on ‘TIME’ to get only time unit and retrieve fields numerator (ZAEHL), denominator (NENNR) and exponent (EXP10) to get time in seconds.

Read More