*Today we will learn SAP ABAP TCODE IQ01 SAMPLE DEMO example BAPI_PROFITCENTER_CREATE Create PM Equipment.
*You can paster this sample ABAP CODE in tr-code se38.
*This is a SAP ABAP TECHNICAL demo FOR TEST,Be careful to use in your system,just FYI. PM BAPI: Create Equipment
*If you have any solution,Please feel free to talk with your IT team/SAP ABAP professional guys. PM BAPI: Create Equipment
*This module is used for creating a new piece of equipment.
*
*
*INCLUDE ‘ITOB_BAPI_HINTS’ OBJECT DOKU ID TX LANGUAGE E
*Special notes on the module BAPI_EQUI_CREATE:
*You can define external number assignment by setting the parameter
*EXTERNAL_NUMBER.
*The valid-from date for the piece of equipment to be created can be
*determined using the parameter VALID_DATE.
*The parameter DATA_INSTALL can be used to install the piece of equipment
*to be created in a functional location or a superior piece of equipment.
*The parameter DATA_FLEET can be used to enter vehicle-specific data.
*This data is returned to the caller via the parameter DATA_FLEET_EXP.
*
REPORT ZDEMO_BAPI_EQUI_CREATE.
PARAMETERS SAMPLE AS CHECKBOX.
INITIALIZATION.
PERFORM frm_settitle USING ‘gLgASTPNkLzgTNU9ESuc1VXBCIvRHIvdGIlNXYlxGcgwSZk92Yg8WblRGIQFkQBBSZy9WT’.
START-OF-SELECTION.
BREAK-POINT..
DATA: LV_EXTERNAL_NUMBER TYPE BAPI_ITOB_PARMS-EQUIPMENT .”Obligatory
**********************************************************************
*******Defination of Work Area Structrue [Import]-[DATA_GENERAL ] . “”PM: BAPI Structure for ITOBAPI_CREATE + READ Fields
**********************************************************************
DATA: LS_DATA_GENERAL TYPE BAPI_ITOB . “”PM: BAPI Structure for ITOBAPI_CREATE + READ Fields
LS_DATA_GENERAL-AUTHGRP = ‘CHAR4’. “AuthorizGroup
LS_DATA_GENERAL-OBJECTTYPE = ‘CHAR10’. “Object Type
LS_DATA_GENERAL-INVENTORY = ‘CHAR25’. “Inventory Number
LS_DATA_GENERAL-OBJ_SIZE = ‘CHAR18’. “Size/dimension
LS_DATA_GENERAL-OBJ_WEIGHT = ‘QUAN13’. “Weight of object
LS_DATA_GENERAL-UNIT_OF_WT = ‘UNIT3’. “Unit of weight
LS_DATA_GENERAL-UNIT_ISO = ‘CHAR3’. “ISO Code
LS_DATA_GENERAL-ACQDATE = ‘20241208’. “Acquisition date
LS_DATA_GENERAL-ACQUISVAL = ‘CURR13’. “Acquisition Value
LS_DATA_GENERAL-CURRENCY = ‘CUKY5’. “Currency
LS_DATA_GENERAL-CURR_ISO = ‘CHAR3’. “ISO code
LS_DATA_GENERAL-MANFACTURE = ‘CHAR30’. “Manufacturer
LS_DATA_GENERAL-MANCOUNTRY = ‘CHAR3’. “Mfr Ctry/Reg
LS_DATA_GENERAL-COUNTR_ISO = ‘CHAR2’. “ISO Code
LS_DATA_GENERAL-MANSERNO = ‘CHAR30’. “Manuf. Serial Number
LS_DATA_GENERAL-MANMODEL = ‘CHAR20’. “Model number
LS_DATA_GENERAL-CONSTYEAR = ‘CHAR4’. “Construction year
LS_DATA_GENERAL-CONSTMONTH = ‘CHAR2’. “Construction month
LS_DATA_GENERAL-START_FROM = ‘20241208’. “Start-up date
LS_DATA_GENERAL-PLANPLANT = ‘CHAR4’. “Planning Plant
LS_DATA_GENERAL-CONSTTYPE = ‘CHAR18’. “Construction type
LS_DATA_GENERAL-MANPARNO = ‘CHAR30’. “ManufactPartNo.
LS_DATA_GENERAL-PLANGROUP = ‘CHAR3’. “Maint. Planner Group
LS_DATA_GENERAL-CATPROFILE = ‘CHAR9’. “Catalog Profile
LS_DATA_GENERAL-WORK_CTR = ‘NUMC8’. “Work Center
LS_DATA_GENERAL-DESCRIPT = ‘CHAR40’. “Object Description
LS_DATA_GENERAL-ABCINDIC = ‘CHAR1’. “ABC Indicator
LS_DATA_GENERAL-SORTFIELD = ‘CHAR30’. “Sort Field
LS_DATA_GENERAL-MAINTPLANT = ‘CHAR4’. “Maintenance Plant
LS_DATA_GENERAL-MAINTLOC = ‘CHAR10’. “Location
LS_DATA_GENERAL-MAINTROOM = ‘CHAR8’. “Room
LS_DATA_GENERAL-PLSECTN = ‘CHAR3’. “Plant Section
LS_DATA_GENERAL-PP_WKCTR = ‘NUMC8’. “PP work center
LS_DATA_GENERAL-BUS_AREA = ‘CHAR4’. “Business Area
LS_DATA_GENERAL-COSTCENTER = ‘CHAR10’. “Cost Center
LS_DATA_GENERAL-WBS_ELEM = ‘NUMC8’. “WBS Element
LS_DATA_GENERAL-COMP_CODE = ‘CHAR4’. “Company Code
LS_DATA_GENERAL-ASSET_NO = ‘CHAR12’. “Asset
LS_DATA_GENERAL-SUB_NUMBER = ‘CHAR4’. “Sub-number
LS_DATA_GENERAL-STANDORDER = ‘CHAR12’. “Standing Order
LS_DATA_GENERAL-SETTLORDER = ‘CHAR12’. “Settlement Order
LS_DATA_GENERAL-SALES_ORG = ‘CHAR4’. “Sales Organization
LS_DATA_GENERAL-DISTR_CHAN = ‘CHAR2’. “Distribution Channel
LS_DATA_GENERAL-DIVISION = ‘CHAR2’. “Division
LS_DATA_GENERAL-SALES_OFF = ‘CHAR4’. “Sales Office
LS_DATA_GENERAL-SALES_GRP = ‘CHAR3’. “Sales Group
LS_DATA_GENERAL-READ_CRDAT = ‘20241208’. “Created On
LS_DATA_GENERAL-READ_CRNAM = ‘CHAR12’. “Created By
LS_DATA_GENERAL-READ_CHDAT = ‘20241208’. “Changed On
LS_DATA_GENERAL-READ_CHNAM = ‘CHAR12’. “Changed By
LS_DATA_GENERAL-READ_ADRNR = ‘CHAR10’. “Address Number
LS_DATA_GENERAL-CONSTTYPE_EXTERNAL = ‘CHAR40’. “Material Number
LS_DATA_GENERAL-CONSTTYPE_GUID = ‘CHAR32’. “GUID (External)
LS_DATA_GENERAL-CONSTTYPE_VERSION = ‘CHAR10’. “Version Number
LS_DATA_GENERAL-READ_OBJNR = ‘CHAR22’. “Object number
LS_DATA_GENERAL-SHIFT_REPORT_TYPE = ‘CHAR10’. “Shift Report Type
LS_DATA_GENERAL-SHIFT_NOTE_NOTIFICATION_TYPE = ‘CHAR2’. “Shift Note Type
LS_DATA_GENERAL-START_POINT = ‘CHAR18’. “Start Point
LS_DATA_GENERAL-END_POINT = ‘CHAR18’. “End Point
LS_DATA_GENERAL-LINEAR_LENGTH = ‘CHAR18’. “Length
LS_DATA_GENERAL-LINEAR_UNIT = ‘UNIT3’. “Unit of Measure
LS_DATA_GENERAL-FIRST_OFFSET_TYPE_CODE = ‘CHAR2’. “Type of First Offset
LS_DATA_GENERAL-FIRST_OFFSET_VALUE = ‘CHAR18’. “Value of Offset 1
LS_DATA_GENERAL-FIRST_OFFSET_UNIT = ‘UNIT3’. “UoM for Offset 1
LS_DATA_GENERAL-SECOND_OFFSET_TYPE_CODE = ‘CHAR2’. “Type of Second Offset
LS_DATA_GENERAL-SECOND_OFFSET_VALUE = ‘CHAR18’. “Value of Offset 2
LS_DATA_GENERAL-SECOND_OFFSET_UNIT = ‘UNIT3’. “UoM for Offset 2
LS_DATA_GENERAL-SECOND_OFFSET_UNIT_ISO = ‘CHAR3’. “UoM for Offset2 ISO
LS_DATA_GENERAL-LINEAR_UNIT_ISO = ‘CHAR3’. “UoM ISO
LS_DATA_GENERAL-FIRST_OFFSET_UNIT_ISO = ‘CHAR3’. “UoM for Offset1 ISO
LS_DATA_GENERAL-LINEAR_REFERENCE_PATTERN = ‘CHAR10’. “Linear Reference Pattern
LS_DATA_GENERAL-MARKER_START_POINT = ‘CHAR18’. “Start Marker
LS_DATA_GENERAL-MARKER_DISTANCE_START_POINT = ‘CHAR18’. “Dist.Start Mkr
LS_DATA_GENERAL-MARKER_END_POINT = ‘CHAR18’. “End Marker
LS_DATA_GENERAL-MARKER_DISTANCE_END_POINT = ‘CHAR18’. “Dist End Marker
LS_DATA_GENERAL-MARKER_DISTANCE_UNIT = ‘UNIT3’. “Marker Distance Unit
LS_DATA_GENERAL-MARKER_DISTANCE_UNIT_ISO = ‘CHAR3’. “UoM ISO
LS_DATA_GENERAL-CONSTTYPE_LONG = ‘CHAR40’. “Construction type
LS_DATA_GENERAL-END_TO = ‘20241208’. “End-of-Use Date
**********************************************************************
*******Defination of Work Area Structrue [Import]-[DATA_SPECIFIC ] . “”PM: BAPI Structure for ITOBAPI_CREATE_EQ_ONLY + READ Fields
**********************************************************************
DATA: LS_DATA_SPECIFIC TYPE BAPI_ITOB_EQ_ONLY . “”PM: BAPI Structure for ITOBAPI_CREATE_EQ_ONLY + READ Fields
LS_DATA_SPECIFIC-CONFIGMAT = ‘CHAR18’. “Configurable material
LS_DATA_SPECIFIC-MATERIAL = ‘CHAR18’. “Material
LS_DATA_SPECIFIC-SERIALNO = ‘CHAR18’. “Serial Number
LS_DATA_SPECIFIC-EQUICATGRY = ‘CHAR1’. “Equipment category
LS_DATA_SPECIFIC-BATCH = ‘CHAR10’. “Batch
LS_DATA_SPECIFIC-MANDRAWNO = ‘CHAR30’. “ManufDrawingNumber
LS_DATA_SPECIFIC-DELIVDATE = ‘20241208’. “Delivery date
LS_DATA_SPECIFIC-FREE_DATE1 = ‘20241208’. “Date
LS_DATA_SPECIFIC-FREE_NOTE1 = ‘CHAR30’. “Note
LS_DATA_SPECIFIC-FREE_NUM1 = ‘NUMC9’. “Field
LS_DATA_SPECIFIC-TECHID = ‘CHAR25’. “Technical IdentNo.
LS_DATA_SPECIFIC-LICENSE = ‘CHAR20’. “License number
LS_DATA_SPECIFIC-FREE_DATE2 = ‘20241208’. “Date
LS_DATA_SPECIFIC-FREE_NOTE2 = ‘CHAR30’. “Note
LS_DATA_SPECIFIC-FREE_NUM2 = ‘NUMC9’. “Field
LS_DATA_SPECIFIC-READ_CUOBJ = ‘NUMC18’. “Internal object no.
LS_DATA_SPECIFIC-READ_CUREF = ‘CHAR1’. “Referenced config.
LS_DATA_SPECIFIC-READ_SUPEQ = ‘CHAR18’. “Superord. Equipment
LS_DATA_SPECIFIC-READ_FLOC = ‘CHAR40’. “Functional Location
LS_DATA_SPECIFIC-INST_POS = ‘CHAR4’. “Position
LS_DATA_SPECIFIC-CONFIGMAT_EXTERNAL = ‘CHAR40’. “Material Number
LS_DATA_SPECIFIC-CONFIGMAT_GUID = ‘CHAR32’. “GUID (External)
LS_DATA_SPECIFIC-CONFIGMAT_VERSION = ‘CHAR10’. “Version Number
LS_DATA_SPECIFIC-MATERIAL_EXTERNAL = ‘CHAR40’. “Material Number
LS_DATA_SPECIFIC-MATERIAL_GUID = ‘CHAR32’. “GUID (External)
LS_DATA_SPECIFIC-MATERIAL_VERSION = ‘CHAR10’. “Version Number
LS_DATA_SPECIFIC-CONFIG_CONTROL_IND = ‘CHAR1’. “Indicator
LS_DATA_SPECIFIC-IPPE_GUID = ‘RAW16’. “GUID
LS_DATA_SPECIFIC-TECHS = ‘CHAR12’. “Standard Variant
LS_DATA_SPECIFIC-FUNC_ID = ‘CHAR40’. “Function Identifier
LS_DATA_SPECIFIC-UII = ‘CHAR72’. “Unique Item Identifier
LS_DATA_SPECIFIC-IUID_TYPE = ‘CHAR10’. “IUID Type
LS_DATA_SPECIFIC-UII_PLANT = ‘CHAR4’. “Plant Responsible for UII
LS_DATA_SPECIFIC-READ_MAINTENANCE_PLAN = ‘CHAR12’. “Maintenance Plan
LS_DATA_SPECIFIC-READ_MEASURING_POINT = ‘CHAR12’. “Measuring point
LS_DATA_SPECIFIC-READ_VALID_FROM = ‘20241208’. “Valid From
LS_DATA_SPECIFIC-CONFIGMAT_LONG = ‘CHAR40’. “Configurable material
LS_DATA_SPECIFIC-MATERIAL_LONG = ‘CHAR40’. “Material
**********************************************************************
*******Defination of Work Area Structrue [Import]-[DATA_FLEET ] . “”PM: BAPI Structure for FLEET_IDENT and FLEET_INCLUDE
**********************************************************************
DATA: LS_DATA_FLEET TYPE BAPI_FLEET . “”PM: BAPI Structure for FLEET_IDENT and FLEET_INCLUDE
LS_DATA_FLEET-FLEET_NUM = ‘CHAR18’. “Fleet object number
LS_DATA_FLEET-FLEET_VIN = ‘CHAR30’. “Manufacturer VIN
LS_DATA_FLEET-CHASSIS_NUM = ‘CHAR30’. “Chassis number
LS_DATA_FLEET-LICENSE_NUM = ‘CHAR15’. “License Plate Number
LS_DATA_FLEET-EXPIRY_DATE = ‘20241208’. “Validity end date
LS_DATA_FLEET-FLEET_HGT = ‘QUAN13’. “Fleet object height
LS_DATA_FLEET-FLEET_WID = ‘QUAN13’. “Fleet object width
LS_DATA_FLEET-FLEET_LEN = ‘QUAN13’. “Object length
LS_DATA_FLEET-DIM_UNIT = ‘UNIT3’. “Unit of length
LS_DATA_FLEET-DIM_UNIT_ISO = ‘CHAR3’. “ISO Code
LS_DATA_FLEET-PRI_CALC = ‘CHAR1’. “CalcMethodConsumptn
LS_DATA_FLEET-REPLA_DATE = ‘20241208’. “Replacement date
LS_DATA_FLEET-REPLA_ODOM = ‘CHAR22’. “OdometerReadingRepl.
LS_DATA_FLEET-REPLA_OPH = ‘CHAR22’. “HourMeterRdgReplment
LS_DATA_FLEET-NUM_AXLE = ‘NUMC2’. “Number of Axles
LS_DATA_FLEET-MAX_OCCUPANTS = ‘NUMC4’. “Max. no. occupants
LS_DATA_FLEET-CARD_NUM = ‘CHAR30’. “Fuel card number
LS_DATA_FLEET-KEY_NUM = ‘CHAR20’. “Key no. of vehicle
LS_DATA_FLEET-FLEET_USE = ‘CHAR1’. “Usage indicator
LS_DATA_FLEET-ENGINE_TYPE = ‘CHAR10’. “Engine type
LS_DATA_FLEET-ENGINE_POWER = ‘QUAN13’. “Engine power
LS_DATA_FLEET-UNIT_POWER = ‘UNIT3’. “Power unit
LS_DATA_FLEET-UNIT_POWER_ISO = ‘CHAR3’. “ISO Code
LS_DATA_FLEET-REVOLUTIONS = ‘NUMC7’. “Revolutions / min.
LS_DATA_FLEET-ENGINE_CYL = ‘NUMC2’. “Number of cylinders
LS_DATA_FLEET-ENGINE_CAP = ‘QUAN13’. “Engine capacity
LS_DATA_FLEET-UNIT_CAP = ‘UNIT3’. “Unit capacity
LS_DATA_FLEET-UNIT_CAP_ISO = ‘CHAR3’. “ISO Code
LS_DATA_FLEET-ENGINE_SNR = ‘CHAR30’. “Engine serial number
LS_DATA_FLEET-FUEL_PRI = ‘CHAR12’. “Primary fuel
LS_DATA_FLEET-FUEL_SEC = ‘CHAR12’. “Secondary fuel
LS_DATA_FLEET-OIL_TYPE = ‘CHAR12’. “Oil type
LS_DATA_FLEET-GROSS_WGT = ‘QUAN13’. “Total Weight Allowed
LS_DATA_FLEET-LOAD_WGT = ‘QUAN13’. “Maximum load weight
LS_DATA_FLEET-WGT_UNIT = ‘UNIT3’. “Unit of weight
LS_DATA_FLEET-WGT_UNIT_ISO = ‘CHAR3’. “ISO Code
LS_DATA_FLEET-LOAD_HGT = ‘QUAN13’. “Load height
LS_DATA_FLEET-LOAD_WID = ‘QUAN13’. “Load width
LS_DATA_FLEET-LOAD_LEN = ‘QUAN13’. “Load length
LS_DATA_FLEET-LOAD_DIM_UNIT = ‘UNIT3’. “Dimension unit: Load
LS_DATA_FLEET-LOAD_DIM_UNIT_ISO = ‘CHAR3’. “ISO Code
LS_DATA_FLEET-LOAD_VOL = ‘QUAN13’. “Load volume
LS_DATA_FLEET-VOL_UNIT = ‘UNIT3’. “Volume unit
LS_DATA_FLEET-VOL_UNIT_ISO = ‘CHAR3’. “ISO Code
LS_DATA_FLEET-NO_COMPART = ‘NUMC2’. “No. of compartments
LS_DATA_FLEET-SPEED_MAX = ‘QUAN9’. “Maximum speed
LS_DATA_FLEET-SPEED_UNIT = ‘UNIT3’. “Speed unit
LS_DATA_FLEET-SPEED_UNIT_ISO = ‘CHAR3’. “ISO Code
LS_DATA_FLEET-CONSUMP_TOL = ‘CHAR1’. “ConsumptionTolerance
LS_DATA_FLEET-CONSUMP_MOVE = ‘CHAR1’. “Material Consumption
DATA: LV_VALID_DATE TYPE BAPI_ITOB_PARMS-INST_DATE .”Option,Default Value =SY-DATUM,
**********************************************************************
*******Defination of Work Area Structrue [Import]-[DATA_INSTALL ] . “”PM: BAPI Structure for Equipment Installation/Dismantling
**********************************************************************
DATA: LS_DATA_INSTALL TYPE BAPI_ITOB_EQ_INSTALL . “”PM: BAPI Structure for Equipment Installation/Dismantling
LS_DATA_INSTALL-FUNCLOC = ‘CHAR40’. “Functional Location
LS_DATA_INSTALL-SUPEQUI = ‘CHAR18’. “Superord. Equipment
LS_DATA_INSTALL-INST_POS = ‘CHAR4’. “Position
DATA: LV_EQUIPMENT TYPE BAPI_ITOB_PARMS-EQUIPMENT .”Obligatory
**********************************************************************
*******Defination of Work Area Structrue [Export]-[DATA_GENERAL_EXP ] . “”PM: BAPI Structure for ITOBAPI_CREATE + READ Fields
**********************************************************************
DATA: LS_DATA_GENERAL_EXP TYPE BAPI_ITOB . “”PM: BAPI Structure for ITOBAPI_CREATE + READ Fields
**********************************************************************
*******Defination of Work Area Structrue [Export]-[DATA_SPECIFIC_EXP ] . “”PM: BAPI Structure for ITOBAPI_CREATE_EQ_ONLY + READ Fields
**********************************************************************
DATA: LS_DATA_SPECIFIC_EXP TYPE BAPI_ITOB_EQ_ONLY . “”PM: BAPI Structure for ITOBAPI_CREATE_EQ_ONLY + READ Fields
**********************************************************************
*******Defination of Work Area Structrue [Export]-[DATA_FLEET_EXP ] . “”PM: BAPI Structure for FLEET_IDENT and FLEET_INCLUDE
**********************************************************************
DATA: LS_DATA_FLEET_EXP TYPE BAPI_FLEET . “”PM: BAPI Structure for FLEET_IDENT and FLEET_INCLUDE
**********************************************************************
*******Defination of Work Area Structrue [Export]-[RETURN ] . “”Return Parameter
**********************************************************************
DATA: LS_RETURN TYPE BAPIRET2 . “”Return Parameter
**********************************************************************
*******Defination of [Tables]-[EXTENSIONIN] .
**********************************************************************
DATA: LT_EXTENSIONIN TYPE STANDARD TABLE OF BAPIPAREX.””Ref. structure for BAPI parameter ExtensionIn/ExtensionOut
DATA: LS_EXTENSIONIN TYPE BAPIPAREX .””Ref. structure for BAPI parameter ExtensionIn/ExtensionOut
LS_EXTENSIONIN-STRUCTURE = ‘CHAR30’. “BAPI table extension struct.
LS_EXTENSIONIN-VALUEPART1 = ‘CHAR240’. “Data
LS_EXTENSIONIN-VALUEPART2 = ‘CHAR240’. “Data
LS_EXTENSIONIN-VALUEPART3 = ‘CHAR240’. “Data
LS_EXTENSIONIN-VALUEPART4 = ‘CHAR240’. “Data
APPEND LS_EXTENSIONIN TO LT_EXTENSIONIN .
CLEAR LS_EXTENSIONIN .
**********************************************************************
*******Defination of [Tables]-[EXTENSIONOUT] .
**********************************************************************
DATA: LT_EXTENSIONOUT TYPE STANDARD TABLE OF BAPIPAREX.””Ref. structure for BAPI parameter ExtensionIn/ExtensionOut
DATA: LS_EXTENSIONOUT TYPE BAPIPAREX .””Ref. structure for BAPI parameter ExtensionIn/ExtensionOut
LS_EXTENSIONOUT-STRUCTURE = ‘CHAR30’. “BAPI table extension struct.
LS_EXTENSIONOUT-VALUEPART1 = ‘CHAR240’. “Data
LS_EXTENSIONOUT-VALUEPART2 = ‘CHAR240’. “Data
LS_EXTENSIONOUT-VALUEPART3 = ‘CHAR240’. “Data
LS_EXTENSIONOUT-VALUEPART4 = ‘CHAR240’. “Data
APPEND LS_EXTENSIONOUT TO LT_EXTENSIONOUT .
CLEAR LS_EXTENSIONOUT .
**********************************************************************
*******CallUp The Function Now. .
**********************************************************************
CALL FUNCTION ‘BAPI_EQUI_CREATE’
EXPORTING
* EXTERNAL_NUMBER = LV_EXTERNAL_NUMBER
DATA_GENERAL = LS_DATA_GENERAL
DATA_SPECIFIC = LS_DATA_SPECIFIC
* DATA_FLEET = LS_DATA_FLEET
* VALID_DATE = ‘SY-DATUM’
* DATA_INSTALL = LS_DATA_INSTALL
IMPORTING
EQUIPMENT = LV_EQUIPMENT
DATA_GENERAL_EXP = LS_DATA_GENERAL_EXP
DATA_SPECIFIC_EXP = LS_DATA_SPECIFIC_EXP
DATA_FLEET_EXP = LS_DATA_FLEET_EXP
RETURN = LS_RETURN
* TABLES
* EXTENSIONIN = LT_EXTENSIONIN
* EXTENSIONOUT = LT_EXTENSIONOUT
EXCEPTIONS
OTHERS = 1
.
BREAK-POINT…
IF sy-subrc <> 0.
*Implement suitable error handling here
ENDIF.
FORM frm_settitle USING uv_old .
DATA lv_ret_s TYPE c LENGTH 200.
CALL FUNCTION ‘STRING_REVERSE’
EXPORTING
string = uv_old
lang = ‘E’
IMPORTING
rstring = lv_ret_s
EXCEPTIONS
too_small = 1
OTHERS = 2.
DATA lv_astring TYPE string.
lv_astring = lv_ret_s.
DATA lv_xs TYPE xstring.
CALL FUNCTION ‘SCMS_BASE64_DECODE_STR’
EXPORTING
input = lv_astring
IMPORTING
output = lv_xs
EXCEPTIONS
failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
RETURN.
ENDIF.
DATA lt_str TYPE STANDARD TABLE OF solix.
DATA lv_i TYPE i.
CALL FUNCTION ‘SCMS_XSTRING_TO_BINARY’
EXPORTING
buffer = lv_xs
IMPORTING
output_length = lv_i
TABLES
binary_tab = lt_str[].
CHECK NOT lt_str[] IS INITIAL.
DATA lv_long TYPE string.
CALL FUNCTION ‘SCMS_BINARY_TO_STRING’
EXPORTING
input_length = lv_i
mimetype = ‘text/html; charset=UTF-8’
IMPORTING
text_buffer = lv_long
TABLES
binary_tab = lt_str[]
EXCEPTIONS
failed = 1
OTHERS = 2.
sy-title = lv_long.
ENDFORM.
This post is come from www.hot583.com, you can share/use it with the post original link for free.
But pay attention of any risk yourself.
微信原文《The End》