/SAPAPO/RRP_CREATE_SORT - Generates Coding for Sort

Vendor Master (General Section)   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.

Functionality

This function module is used to sort tables.

The following are transferred:

  • The name of the structure of the table to be sorted (ESNAME)
  • The parameter EBUILD which controls how the table is to be built up or completed with the fields that can be sorted SORTX.

The parameter EBUILD can have the following characteristics:

  • initial (SPACE): The table SORTX is completely rebuilt. During this
process, all fields of the structure ESNAME are used.
  • X: The table SORTX is merely sorted before it is displayed but
apart from that it remains unchanged.
  • F: The key texts for the fields are read, SORTX is sorted, but
apart from that it remains unchanged.

It is therefore possible to either let the table SORTX be built up, which is to recommended when allfields of a structure are to be sorted in ascending order, or to preallocate the table in the program that calls the table.

If you choose Sort in the dialog box that is called up from the function module, thesort routine DO_SORT is generated in the main memory. The export parameter 'IFCODE' is given the value 'DOSO' (DO SOrt), the parameter 'IPNAME', is given the name of the program, when 'DO_SORT' is generated.

In the program that calls up the sort routine is then called up.

Example

The call could be as follows:

*--> Call sort dialog box / Generate sort codings

CALL FUNCTION 'MD_CREATE_SORT'

EXPORTING

ESNAME = 'MDKE'

EBUILD = SORT_AUFBAU

IMPORTING

IPNAME = L_PNAME

IFCODE = L_FCODE

TABLES

SORTX = SORTX.

*--> Set build up indicator

MOVE 'X' TO SORT_AUFBAU.

IF NOT L_PNAME IS INITIAL

AND L_FCODE EQ 'DOSO'.

*--> Execute sorting

PERFORM DO_SORT IN PROGRAM (L_PNAME) TABLES MDKEX.

ENDIF.

Notes

Further information


Parameters

EV_PNAME
IT_SORTX
IV_STRUCNAME

Exceptions

ERROR

Function Group

APO/SAPLRRP_TREE

TXBHW - Original Tax Base Amount in Local Currency   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.


Length: 2425 Date: 20120525 Time: 102038     triton ( 114 ms )