Monday, July 7, 2014

Useful function modules


/SAPAPO/DM_PROD_LOC_READ  - Multiple matid & locid related data
/SAPAPO/LOC_GET_LOCT -- FM to get the location text
/SAPAPO/DM_MAT_TEXT_GET - material text

Function modules related to resource:
/SAPAPO/BLRG_RESNAME_GETRESUID - From res. ID get the resource name

Function Modules SAP APO Transportation lanes
  Read the overall transportation lanes
    '/SAPAPO/TR_TR_READ'
  Read means of transport
      '/SAPAPO/TR_TRM_READ'
    "Read version-dependent means of transport
        '/SAPAPO/TR_GET_TRMV'
  Read product-specific lanes
    '/SAPAPO/TR_TRPROD_READ'
  Read version-dependent sources of supply
      '/SAPAPO/TR_GET_TRPRODV'
  Read product-specific means of transport
      '/SAPAPO/TR_TRPRODM_READ'
  Read Transport Service Providers
      '/SAPAPO/TR_TRMCARR_READ'
  Read procurement relationships
      '/SAPAPO/MMPUR_TPSRC_GET_ALL'

APO Function modules related to timestamp
/SAPAPO/TIMESTAMP_ADD - Time Stamp 1 + Duration = Time Stamp 2
/SAPAPO/DURATION_GET_SECONDS-  Determines Duration in Seconds from Duration HHHHHH:MM:SS
/SAPAPO/SECONDS_GET_DURATION - Converts Duration in Seconds to Format HHHHHH:MM:SS
/SAPAPO/TIMESTAMP_DIFFERENCE - Time Stamp 1 - Time Stamp 2 = Duration
/SAPAPO/TIMESTAMP_SUBTRACT - Time Stamp 1 - Duration = Time Stamp 2
/SAPAPO/TIMESTAMP_ZONE_TO_UTC - local timestamp to UTC
/SAPAPO/TST_UTC_TO_LOCAL - UTC to local timestamp, date, time
Also, the abap command  GET TIME STAMP FIELD could be used to get the current timestamp.

APO MRP Related FM
'/SAPAPO/RRP_LC_IO_SCHEDULE' - Function module to reschedule an order. Here only the end data should passed for an order. The start date will be calculated automatically by the FM. If the start date is having date less than the plan start date (plan start date, is calculated according to the strategy settings) then this FM module will give the error, with code 44. Hence check beforehand the how much time is required to complete the order and calculate the start date and then check start date with plan start date.




Substract the seconds from the timestamp:

CALL METHOD CL_ABAP_TSTMP=>SUBTRACTSECS
  EXPORTING
    TSTMP   = TIME_STAMP
    SECS    = L_SECONDS
  RECEIVING
    R_TSTMP = TIME_STAMP.

1 comment:

  1. Thanks for sharing this Informative content. Well explained. Got to learn new things from your Blog on SAP online access Sap simple logistic online access

    ReplyDelete