‎2007 Oct 12 2:08 PM
Hi Gurus, i'm trying to assign some roles to Tcode PP02, run the recording, perform the mapping, finally running using call transaction. no syntax errors, but no output.
can any one suggest.
TABLES: pernr, YHR_00_ROLAUTH.
INFOTYPES: 0000,
0001.
TYPE-POOLS: slis.
TYPES: BEGIN OF ty_auth,
PERNR TYPE PERSNO,
posin type objid,
molga type molga,
plvar type PLVAR,
ISTAT type ISTAT_D,
OTYPE type OTYPE,
SUBTY type SUBTYP,
INFTY type INFOTYP,
SOBID type SOBID,
RELAT type RELAT,
begda type datum,
endda type datum,
zrole type char25,
END OF ty_auth.
DATA: i_hrp1000 TYPE TABLE OF hrp1000 WITH HEADER LINE,
i_hrp1001 TYPE TABLE OF hrp1001 WITH HEADER LINE,
i_p0000 TYPE TABLE OF pa0000 WITH HEADER LINE,
i_auth TYPE TABLE OF ty_auth WITH HEADER LINE,
i_yhr_roles type table of YHR_00_ROLAUTH with header line,
it_bdcdata like bdcdata occurs 0 with header line,
it_bdcmsgcoll like bdcmsgcoll occurs 0 with header line.
loop at i_auth.
PERFORM assign_rol_frns.
endif.
endloop.
FORM assign_rol_frns .
*perform open_group.
perform bdc_dynpro using 'SAPMH5A0' '1000'.
perform bdc_field using 'BDC_CURSOR'
'PPHDR-SUBTY'.
perform bdc_field using 'BDC_OKCODE'
'=INSE'.
'/00' .
perform bdc_field using 'PPHDR-PLVAR'
'i_auth-plvar'.
perform bdc_field using 'PPHDR-OTYPE'
'i_auth-otype'.
perform bdc_field using 'PM0D1-SEARK'
'i_auth-posin'.
perform bdc_field using 'PPHDR-INFTY'
'i_auth-infty'.
perform bdc_field using 'PPHDR-SUBTY'
'i_auth-subty'.
perform bdc_field using 'PPHDR-ISTAT'
'i_auth-istat'.
perform bdc_field using 'PPHDR-BEGDA'
'i_auth-begda'.
perform bdc_field using 'PPHDR-ENDDA'
'i_auth-endda'.
perform bdc_dynpro using 'MP100100' '2000'.
perform bdc_field using 'BDC_CURSOR'
'P1001-SOBID'.
perform bdc_field using 'P1001-SCLAS'
'i_auth-sclas'.
perform bdc_field using 'P1001-SOBID'
'i_auth-zauth'.
perform bdc_field using 'BDC_OKCODE'
'=UPD'.
*perform bdc_transaction using 'PP02'.
*perform close_group.
call transaction 'PP02' using it_bdcdata
mode 'A'
update 'S' messages into it_bdcmsgcoll.
ENDFORM. " assign_rol_frns
&----
*& Form bdc_dynpro
&----
text
----
-->PROG text
-->SCR text
----
form bdc_dynpro using prog scr.
clear it_bdcdata.
it_bdcdata-program = prog.
it_bdcdata-dynpro = scr.
it_bdcdata-dynbegin = 'X'.
append it_bdcdata.
endform. "bdc_dynpro
*if fnam =
form bdc_field using fnam fval.
clear it_bdcdata.
it_bdcdata-fnam = fnam.
it_bdcdata-fval = fval.
append it_bdcdata.
endform. "bdc_field
*&----
**& Form open_group
*&----
*FORM open_group .
*
*CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = GROUP
HOLDDATE = SY-DATUM
KEEP = KEEP
USER = USER
*.
*
*ENDFORM. " open_group
&----
**& Form close_group
*&----
Close group for fr.
*----
*FORM close_group .
*
*CALL FUNCTION 'BDC_CLOSE_GROUP'.
*
*ENDFORM. " close_group
if i_auth-molga = '06'.
‎2007 Oct 12 2:10 PM
Hi,
Use sy-subrc to get the status whether the Call transcation succesfully completed or not.
If sy-subrc NE 0.
write : 'UnSuccessfull'.
endif.
Or
Do the error handling.
Thanks,
Sriram Ponna.
‎2007 Oct 12 2:11 PM
‎2007 Oct 12 2:17 PM
Hi vamsi,
look at this:
you wrote: perform bdc_field using 'PPHDR-PLVAR' <b>'i_auth-plvar'</b>.
I think you will the value of i_auth-plvar, isn't it. Delete the ''.
Therefore you have to use this:
perform bdc_field using 'PPHDR-PLVAR' <b>i_auth-plvar</b>.
Regards, Dieter
‎2007 Oct 12 2:22 PM
Hi vamsi,
I feel this statement is wrong
perform bdc_field using 'PPHDR-ENDDA' 'i_auth-endda'.
instead of this pass the internal table without single code ie it should be like
perform bdc_field using 'PPHDR-ENDDA' i_auth-endda.
change in the other perfoms also .It might work.
Ratna