cancel
Showing results for 
Search instead for 
Did you mean: 

Sample code to call BAPI BAPI_PDSSRVAPS_GETLIST

Former Member
0 Kudos

I am trying to use BAPI_PDSSRVAPS_GETLIST to get the PDS details. Could anyone tell me how to use this Function to get the data. I mean to say, i need to know what would be the import and export parameters of this FM. If any have a sample code, would be a great help.

I

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

There are 2 ways to read the PDS using this BAPI.

1) Selection using explicit key: PdsKey

PDSKey is combination of following fields:

PdsName = Name of the external key for the source of supply, for example, a PPM or a PDS.

PdsUsage = The following usages are currently possible:

"P": Production data structure for Production Planning and Detailed Scheduling (PP/DS)

"S": Production data structure for Supply Network Planning (SNP)

"D": Production data structure for Demand Planning (DP)

"C": Production data structure for CTM planning (CTM)

PlanningVersion = Indicates the name of the planning version .

The entire key must always be specified.

2) Selection using RANGES tables:

PdsSelection (optional)

ProductSelection (optional)(You can specify products here like

SIGN= I

OPTION= EQ

LOW= 1234

HIGH = ' ')

LocationSelection (optional)(Specify Location for which you want to read PDS)

PlanningVersionSelection (optional)

SIGN=I

OPTION=EQ

LOW=000

PdsUsage (optional)= P or S or D or C

By specifying a selection period for the generation date, (GenerationDateFrom, GenerationDateTo) you can also restrict the number of PDS change statuses to be read when using any of the selection variants.

Note that you must also specify the logical system (or the business system group) for all the selection variants.

Please find below sample code in which I am reading capacity requirement by passing PDSKEY to the BAPI.

  • Obtain current Logical System

CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'

IMPORTING

own_logical_system = v_logsys

EXCEPTIONS

own_logical_system_not_defined = 1

OTHERS = 2.

  • Determine PDS Key

CLEAR w_pdskey.

w_pdskey-pds_name = w_trprod-ext_name."External Name of PDS

w_pdskey-pds_usage = 'S'. " For SNP PDS - 'S'

w_pdskey-planning_version = '000'. "Planning Version

APPEND w_pdskey TO t_pdskey.

  • Read the PDS - Obtain Capacity Requirements for PDS

CALL FUNCTION 'BAPI_PDSSRVAPS_GETLIST'

EXPORTING

logical_system = v_logsys "Logical System

TABLES

pds_key = t_pdskey

pds_capacity_requirement = t_capreq.

  • Remove Duplicates from Capacity Requirements

SORT t_capreq BY operation activity resource.

DELETE ADJACENT DUPLICATES FROM t_capreq COMPARING operation activity resource.

I hope now you can use this BAPI to read PDS.

If your query answered correctly please close the thread.

Regards,

Saurabh

Former Member
0 Kudos

Thanks Saurabh.I passed the data exactly like the way, you had mentioned in your mail, BAPI retuned the PDS data.Thanks alot for the reply.

Answers (0)