Showing posts with label tips. Show all posts
Showing posts with label tips. Show all posts

Interactive report example in ABAP


Interactive report example:-

In this example we tried to show how the interactive report works. Here for a storage location, we will get a list of material and will get the creation date and last changes date for material (MATNR) on double click Event AT LINE-SELECTION.


tables :mard.
DATA : wa_mard TYPE mard,
       it_mard TYPE  STANDARD TABLE OF mard.

DATA : wa_mara TYPE mara,
       it_mara TYPE STANDARD TABLE OF mara.

PARAMETERS LGORT TYPE mard-LGORT.

SELECT *
FROM mard
INTO TABLE  it_mard
WHERE LGORT eq LGORT.

LOOP AT it_mard INTO wa_mard.
  WRITE : /1 wa_mard-matnr ,
           20 wa_mard-WERKS color 4,
           40 wa_mard-PSTAT color 5.
  HIDE wa_mard-matnr. "-*Here the contents of the line selected will be stored
ENDLOOP.

AT LINE-SELECTION.
  ULINE.
  IF sy-lsind = 1.
    WRITE :  /1 'MATERIAL NO'color 1,
             20 'Created On',
             40 'Date of Last Change'color 2.
    ULINE.
  ENDIF.
SELECT *
FROM mara
INTO TABLE it_mara  "
WHERE matnr = wa_mard-matnr. "contents of the line from above
  LOOP AT it_mara INTO wa_mara.
    WRITE :  /1 wa_mara-matnr color 1,
             20 wa_mara-ERSDA ,
             40 wa_mara-LAEDA color 2.

  ENDLOOP.
TOP-OF-PAGE.
  WRITE : /1 'MATERIAL NO' ,
         20  'Maintenance status'color 4,
         40  'Created On'color 5.
  ULINE .

Execute the report

Click execute
output

Click on the 271 (material number)
Debug view

Now we got the creation and last changes date


Protected by Copyscape Web Copyright Checker

Workflow Tips 1


Macro Instructions for Processing a Container 

INCLUDE <cntn01>.
 Use
You can use these macro instructions for the following programs:
  • Implementation programs of object types
  • Function modules for event creation
  • Function modules for rule resolution
  • ABAP classes (for example, for use in programmer exits)
Processing a container instance includes:
  • Accessing the value of a container element
  • Entering a value for a container element
The container must be declared and initialized with the following macro instructions:


SWC_CONTAINER <Container>."Declaration
SWC_CREATE_CONTAINER <Container>. "Initialization




Standard tasks and customer tasks



Standard task
  • Organizational object type TS
  • Cross client
  • Any plan version
  • No validity period
Customer task
  • Organizational object type T
  • Client specific
  • Plan version specific
  • Validity period
Only standard tasks will be supported in future releases.


A task described by an object method. 


Go to the PFTS t code --- for standard task
Go to the PFT t code   --- for  task














Workflow Definition describe in business process 



Get fiscal year and period


Get fiscal year and period

CALL FUNCTION 'BAPI_COMPANYCODE_GET_PERIOD'
    EXPORTING
      companycodeid = p_bukrs t001
      posting_date  = p_bedat posting date
    IMPORTING
      fiscal_year   = g_f_fiscaly
      fiscal_period = g_f_fiscalp.