Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Details about BAPI_ACTIVITY_GETDETAIL

Former Member
0 Kudos

Hi All,

can u tell me the documentation about BAPI_ACTIVITY_GETDETAIL

Thanks to all

1 REPLY 1

Former Member
0 Kudos

Hi,

Here is the sample code...

*--- local fields

DATA: f_node TYPE i,

f_acty TYPE i,

f_obj TYPE i,

ga_act TYPE i,

gv_act TYPE i,

oa_act TYPE i,

ov_act TYPE i,

f_dianode TYPE i,

f_occnode TYPE i,

line LIKE sy-tabix.

*--- local tables

DATA: procdiaheader LIKE bapibedih,

diavarheader LIKE bapibedvh,

occdiavarheader LIKE bapibedvh,

procdianodes LIKE bapibedin OCCURS 0,

procdialines LIKE bapibedil OCCURS 0,

diavaractivenodes LIKE bapibedvn OCCURS 0,

occdiavaractivenodes LIKE bapibedvn OCCURS 0,

processevents LIKE bapibeevt OCCURS 0,

activities LIKE bapibeact OCCURS 0,

return LIKE bapiret2 OCCURS 0.

*--- local work areas

DATA: wa_procdianodes LIKE bapibedin,

wa_procdialines LIKE bapibedil,

wa_diavaractivenodes LIKE bapibedvn,

wa_occdiavaractivenodes LIKE bapibedvn,

wa_processevents LIKE bapibeevt,

wa_activities LIKE bapibeact.

*--- read all data for one activity

CALL FUNCTION 'BAPI_ACTIVITY_GETDETAIL'

EXPORTING

activityid = p_activtiy

language = p_language

languageiso = p_languageiso

IMPORTING

procdiaheader = procdiaheader

diavarheader = diavarheader

occdiavarheader = occdiavarheader

TABLES

procdianodes = procdianodes

procdialines = procdialines

diavaractivenodes = diavaractivenodes

occdiavaractivenodes = occdiavaractivenodes

processevents = processevents

activities = activities

return = return.

APPEND LINES OF return TO p_return.

*--- activities in nodes

LOOP AT activities INTO wa_activities.

READ TABLE procdianodes WITH KEY

activity = wa_activities-node_guid INTO wa_procdianodes.

IF sy-subrc = 0.

ELSE.

f_acty = f_acty + 1.

ENDIF.

ENDLOOP.

*--- nodes in activities

LOOP AT procdianodes INTO wa_procdianodes WHERE node_type = 'AC'.

READ TABLE activities WITH KEY

node_guid = wa_procdianodes-activity INTO wa_activities.

IF sy-subrc = 0.

ELSE.

f_node = f_node + 1.

ENDIF.

ENDLOOP.

*--- funktion in activities

LOOP AT procdianodes INTO wa_procdianodes WHERE node_type = 'FU'.

READ TABLE activities WITH KEY

ref_object = wa_procdianodes-obj_def INTO wa_activities.

IF sy-subrc = 0.

ELSE.

f_obj = f_obj + 1.

ENDIF.

ENDLOOP.

*--- global variants

LOOP AT activities INTO wa_activities.

READ TABLE procdianodes WITH KEY

activity = wa_activities-node_guid INTO wa_procdianodes.

IF sy-subrc = 0.

READ TABLE diavaractivenodes WITH KEY

node_id = wa_procdianodes-node_id INTO wa_diavaractivenodes.

IF sy-subrc = 0.

IF wa_activities-var_active = 'X'

AND wa_diavaractivenodes = ' '.

ga_act = ga_act + 1.

ENDIF.

IF wa_activities-var_active = ' '

AND wa_diavaractivenodes = 'X'.

gv_act = gv_act + 1.

ENDIF.

ELSE.

ENDIF.

ENDIF.

ENDLOOP.

<b>Reward points if this helps.

Manish</b>