*&---------------------------------------------------------------------*
*& Include ZXCN1U06 *
*&---------------------------------------------------------------------*
*declaracao de dados para tratamento das transacoes CJ30,CJ32,CJ37,cj38
DATA: tvarvc TYPE tvarvc.
DATA: v_text(40) TYPE c.
DATA: i_tget_exp LIKE bpge_id.
DATA: li_qtdreg TYPE i.
FIELD-SYMBOLS: <fs_tge> TYPE STANDARD TABLE.
FIELD-SYMBOLS: <fs_tget> TYPE bpge_id.
FIELD-SYMBOLS: <fs_tget_aux> TYPE bpge_id.
IF sy-tcode EQ 'CJ30' OR
sy-tcode EQ 'CJ32' OR
sy-tcode EQ 'CJ37' OR
sy-tcode EQ 'CJ38'.
v_text = '(SAPLKBPP)T_GE[]'.
ASSIGN (v_text) TO <fs_tge>.
IF <fs_tge> IS ASSIGNED.
li_qtdreg = lines( <fs_tge> ).
LOOP AT <fs_tge> ASSIGNING <fs_tget>.
CASE sy-tcode.
WHEN 'CJ30' OR 'CJ32'.
IF <fs_tget>-vorga = 'KBUD'.
MOVE <fs_tget> TO i_tget_exp.
* Export to class ZCL_IM__IM_BEHAVIOUR
EXPORT i_tget_exp TO MEMORY ID 'i_tget_exp'.
EXIT.
ENDIF.
WHEN 'CJ37'.
IF <fs_tget>-vorga = 'KBN0'.
MOVE <fs_tget> TO i_tget_exp.
* Export to class ZCL_IM__IM_BEHAVIOUR
EXPORT i_tget_exp TO MEMORY ID 'i_tget_exp'.
EXIT.
ELSEIF sy-tabix = li_qtdreg.
READ TABLE <fs_tge> INDEX 1 ASSIGNING <fs_tget_aux>.
MOVE <fs_tget_aux> TO i_tget_exp.
CLEAR: i_tget_exp-wtges.
* Export to class ZCL_IM__IM_BEHAVIOUR
EXPORT i_tget_exp TO MEMORY ID 'i_tget_exp'.
ENDIF.
WHEN 'CJ38'.
IF <fs_tget>-vorga = 'KBR0'.
MOVE <fs_tget> TO i_tget_exp.
* Export to class ZCL_IM__IM_BEHAVIOUR
EXPORT i_tget_exp TO MEMORY ID 'i_tget_exp'.
EXIT.
ELSEIF sy-tabix = li_qtdreg.
READ TABLE <fs_tge> INDEX 1 ASSIGNING <fs_tget_aux>.
MOVE <fs_tget_aux> TO i_tget_exp.
CLEAR: i_tget_exp-wtges.
* Export to class ZCL_IM__IM_BEHAVIOUR
EXPORT i_tget_exp TO MEMORY ID 'i_tget_exp'.
ENDIF.
* Declaracao de dados para implementacao das transacoes CJ30, CJ32,CJ38
DATA: tvarvc TYPE tvarvc.
DATA: v_text(40) TYPE c.
DATA: i_tget_exp TYPE bpge_id.
FIELD-SYMBOLS: <fs_tge> TYPE ANY TABLE,
<fs_tget> TYPE bpge_id.
IF sy-tcode EQ 'CJ30' OR
sy-tcode EQ 'CJ32' OR
sy-tcode EQ 'CJ37' OR
sy-tcode EQ 'CJ38'.
* Import da EXIT_SAPLCNAU_002
IMPORT i_tget_exp TO i_tget_exp FROM MEMORY ID 'i_tget_exp'.
v_text = '(SAPLKBPP)T_GE[]'.
ASSIGN (v_text) TO <fs_tge>.
LOOP AT <fs_tge> ASSIGNING <fs_tget>.
IF <fs_tget>-epos = 'X'.
* Conditions CJ30
IF ( sy-tcode = 'CJ30' AND <fs_tget>-vorga = 'KBUD' ) AND
( ( <fs_tget>-objnr EQ i_tget_exp-objnr AND
<fs_tget>-wtges NE i_tget_exp-wtges ) OR
( <fs_tget>-wtges NE i_tget_exp-wtges AND
i_tget_exp-objnr IS INITIAL ) )
* Conditions CJ32
OR ( sy-tcode = 'CJ32' AND <fs_tget>-vorga = '*ADD' )
* Conditions CJ37
OR ( sy-tcode = 'CJ37' AND <fs_tget>-vorga = 'KBN0' ) AND
( <fs_tget>-objnr EQ i_tget_exp-objnr AND
<fs_tget>-wtges NE i_tget_exp-wtges )
* Conditions CJ38
OR ( sy-tcode = 'CJ38' AND <fs_tget>-vorga = 'KBR0' ) AND
( <fs_tget>-objnr EQ i_tget_exp-objnr AND
<fs_tget>-wtges NE i_tget_exp-wtges ).
SELECT SINGLE *
FROM tvarvc
INTO tvarvc
WHERE name = 'PS_CONT_ORC_N1'
AND low = sy-uname.
IF sy-subrc NE 0.
MESSAGE ID 'ZPS' TYPE 'E' NUMBER '117' WITH sy-uname.
ENDIF.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.