MUNDOSAP

Regresar   MUNDOSAP > DESARROLLO > Programación ABAP IV
Nombre de Usuario
Contraseña
Home Descargas Registrar FAQ Miembros Calendario Buscar Temas de Hoy Marcar Foros Como Leídos




 
Respuesta
 
Herramientas Buscar en Tema Desplegado
  #11  
Viejo 22/08/08, 15:29:23
nasly alexandra correa nasly alexandra correa is offline
Junior Member
 
Fecha de Ingreso: nov 2007
Mensajes: 7
Wink

ESTE ES EL RESTO DE CODIGO DEL EL REPORTE . AQUI ESTAN LAS 2 FUNCIONES.


* Obtiene el resultado del batch, sea positiva o negativa.
perform batch_geterror(zmiscl) using errtext.
wa_users-msg1 = errtext(2).
vc_msg1 = errtext(2).

* Realiza el proceso de ajuste para el Rol depurado.
* Función obtenida del programa estándar "LPRGN_TREEI0J" en la línea de código número 34 aproximadamente la
* cual es ejecutada por el programa estándar al momento de ajustar el Rol por medio de la transacción "PFCG"
* Se invoca esta función directamente debido a que el proceso de ajuste del Rol por medio del Batch, no
* ajusta el Rol a pesar de que se ejecute el proceso correctamente.
call function 'PRGN_ACTIVITY_GROUP_USERPROF'
exporting
activity_group = wa_users-agr_name
hr_mode = 'X'
delete_invalid_profiles = ' '
exceptions
no_authority_for_user_compare = 1
at_least_one_user_enqueued = 2
authority_incomplete = 3
no_profiles_available = 4
too_many_profiles_in_user = 5
others = 6.
if sy-subrc = 0 .
call function 'PRGN_CHECK_USERPROF_STATUS'
exporting
activity_group = wa_users-agr_name
importing
led_color = loc_led_color.
if loc_led_color = 'GREEN'.
vc_msg2 = 'OK'.
else.
vc_msg2 = 'ER'.
endif.
else.
vc_msg2 = 'ER'.
endif.

endif.

wa_users-msg1 = vc_msg1.
wa_users-msg2 = vc_msg2.
modify ti_users index vn_tabix from wa_users
transporting msg1 msg2.

endloop.

* Se forza la actualización en la Base de datos para luego verificar la integridad de los demas datos.
commit work.

* Verifica que si haya ingresado por lo menos en un rol.
if not r_agrnam is initial.

* Verifica la integridad de datos.
loop at ti_users into wa_users where agr_name in r_agrnam.
vn_tabix = sy-tabix.
* Verifica que se haya borrado el registro indicado.
if ( wa_users-borrar = 'X' ) and ( wa_users-causa in s_causa ).
select single * from agr_users
where agr_name = wa_users-agr_name
and uname = wa_users-uname
and from_dat = wa_users-from_dat
and to_dat = wa_users-to_dat.
if sy-subrc = 0.
wa_users-integridad = 'X'.
endif.
* Verifica la integridad de los otros datos del rol
else.
select single * from agr_users
where agr_name = wa_users-agr_name
and uname = wa_users-uname
and from_dat = wa_users-from_dat
and to_dat = wa_users-to_dat.
if sy-subrc <> 0.
clear t.
refresh t.

write: wa_users-from_dat to vc_fromdat,
wa_users-to_dat to vc_todat.

perform batch_insdata(zmiscl) tables t using :
'X' 'SAPLPRGN_TREE' '0121',
' ' 'AGR_NAME_NEU' wa_users-agr_name,
' ' 'BDC_OKCODE' '=AEND',

'X' 'SAPLPRGN_TREE' '0300',
' ' 'BDC_OKCODE' '=TAB3',

'X' 'SAPLPRGN_TREE' '0300',
' ' 'BDC_OKCODE' '=P++',

'X' 'SAPLPRGN_TREE' '0300',
' ' 'S_USER-UNAME(01)' wa_users-uname,
' ' 'S_USER-FROM_DAT(01)' vc_fromdat,
' ' 'S_USER-TO_DAT(01)' vc_todat,
' ' 'BDC_OKCODE' '=SAVE'.

* Ejecutar transacción 'PFCG' e ingresa el Rol seleccionado segun los criterios indicados
call transaction 'PFCG' using t mode p_mode update 'S'.

* Obtiene el resultado del batch, sea positiva o negativa.
perform batch_geterror(zmiscl) using errtext.
wa_users-msg1 = errtext(2).
vc_msg1 = errtext(2).

* Realiza el proceso de ajuste para el Rol depurado.
* Función obtenida del programa estándar "LPRGN_TREEI0J" en la línea de código número 34 aproximadamente la
* cual es ejecutada por el programa estándar al momento de ajustar el Rol por medio de la transacción "PFCG"
* Se invoca esta función directamente debido a que el proceso de ajuste del Rol por medio del Batch, no
* ajusta el Rol a pesar de que se ejecute el proceso correctamente.

call function 'PRGN_ACTIVITY_GROUP_USERPROF'
exporting
activity_group = wa_users-agr_name
hr_mode = 'X'
delete_invalid_profiles = ' '
exceptions
no_authority_for_user_compare = 1
at_least_one_user_enqueued = 2
authority_incomplete = 3
no_profiles_available = 4
too_many_profiles_in_user = 5
others = 6.
if sy-subrc = 0 .
call function 'PRGN_CHECK_USERPROF_STATUS'
exporting
activity_group = wa_users-agr_name
importing
led_color = loc_led_color.
if loc_led_color = 'GREEN'.
vc_msg2 = 'OK'.
else.
vc_msg2 = 'ER'.
endif.
else.
vc_msg2 = 'ER'.
endif.

wa_users-msg1 = vc_msg1.
wa_users-msg2 = vc_msg2.
wa_users-causa = 9.
wa_users-integridad = 'X'.
endif.
endif.

modify ti_users index vn_tabix from wa_users
transporting causa msg1 msg2 integridad.

* Realiza el conteo de GA´s depurados por causa y tambien el total general.
if wa_users-causa in s_causa.
vn_deptotal = vn_deptotal + 1.
case wa_users-causa.
when '1'.
vn_depcausa1 = vn_depcausa1 + 1.
if ( wa_users-msg1 = 'ER' ) or ( wa_users-msg2 = 'ER' ) or ( wa_users-integridad = 'X' ).
vc_errcausa1 = 'X'.
endif.
when '2'.
vn_depcausa2 = vn_depcausa2 + 1.
if ( wa_users-msg1 = 'ER' ) or ( wa_users-msg2 = 'ER' ) or ( wa_users-integridad = 'X' ).
vc_errcausa2 = 'X'.
endif.
when '3'.
vn_depcausa3 = vn_depcausa3 + 1.
if ( wa_users-msg1 = 'ER' ) or ( wa_users-msg2 = 'ER' ) or ( wa_users-integridad = 'X' ).
vc_errcausa3 = 'X'.
endif.
when '4'.
vn_depcausa4 = vn_depcausa4 + 1.
if ( wa_users-msg1 = 'ER' ) or ( wa_users-msg2 = 'ER' ) or ( wa_users-integridad = 'X' ).
vc_errcausa4 = 'X'.
endif.
when '9'.
vn_depcausa9 = vn_depcausa9 + 1.
if ( wa_users-msg1 = 'ER' ) or ( wa_users-msg2 = 'ER' ) or ( wa_users-integridad = 'X' ).
vc_errcausa9 = 'X'.
endif.
endcase.
endif.
endloop.

write 'RESULTADO DE LA DEPURACIÓN DE GAs'.
skip 1.
write: 'CONDICIONES DE BORRADO PARA LOS GAs DEPURADOS. Total Depurados = ', vn_deptotal.
new-line.
if vc_errcausa1 = 'X'.
format color 3.
endif.
write: ' 1 - GAs con diferente fecha de asignación (from), borrado el más reciente. Total Causa 1 = ', vn_depcausa1.
format reset.
format intensified on.
new-line.
if vc_errcausa2 = 'X'.
format color 3.
endif.
write: ' 2 - GA asignado a compuesto comparado con otro GA, borrado el GA no asignado al compuesto. Total Causa 2 = ', vn_depcausa2.
format reset.
format intensified on.
new-line.
if vc_errcausa3 = 'X'.
format color 3.
endif.
write: ' 3 - GAs con diferentes fecha de vigencia (to), borrado el de menor vigencia. Total Causa 3 = ', vn_depcausa3.
format reset.
format intensified on.
new-line.
if vc_errcausa4 = 'X'.
format color 3.
endif.
write: ' 4 - GAs con fecha de vigencia vencida. Total Causa 4 = ', vn_depcausa4.
format reset.
format intensified on.
new-line.
if vc_errcausa9 = 'X'.
format color 6.
endif.
write: ' 9 - GAs ingresados nuevamente después del proceso de depuración. Total Causa 9 = ', vn_depcausa9.
format reset.
format intensified on.
skip 1.
write 'Rol Usuario De A Causa Borrado Ajustado Observación'.

loop at ti_users into wa_users where agr_name in r_agrnam.
* Imprime los registros borrados y el resultado tanto de la eliminacion, como de la activacón del rol
if ( wa_users-borrar = 'X' ) and ( wa_users-causa in s_causa ).
new-line.
if ( wa_users-msg1 = 'ER' ) or ( wa_users-msg2 = 'ER' ) or ( wa_users-integridad = 'X' ).
format color 3.
endif.
write: wa_users-agr_name,
wa_users-uname,
wa_users-from_dat,
wa_users-to_dat,
wa_users-causa,
' ',
wa_users-msg1,
' ',
wa_users-msg2,
' '.
format reset.
format intensified on.
* Imprime los registros reingresados y el resultado tanto del ingreso, como de la activacón del rol
else.
if wa_users-integridad = 'X'.
new-line.
format color 6.
write: wa_users-agr_name,
wa_users-uname,
wa_users-from_dat,
wa_users-to_dat,
wa_users-causa,
' ',
' ',
' ',
wa_users-msg2,
' ',
'Ingresado Nuevamente =',
wa_users-msg1,
' '.
format reset.
format intensified on.
endif.
endif.
endloop.

endif.
else.
message e003(zbs).
endif.
Responder Con Cita
  #12  
Viejo 25/08/08, 06:41:57
bisonye bisonye is offline
Senior Member
 
Fecha de Ingreso: ago 2006
Mensajes: 635
Pues no parece que sea un problema de las funciones. Intenta hacer una nueva grabación pero marcando el flag de proceso de fondo a ver si te funciona.

Saludos
Responder Con Cita
  #13  
Viejo 27/08/08, 21:28:36
nasly alexandra correa nasly alexandra correa is offline
Junior Member
 
Fecha de Ingreso: nov 2007
Mensajes: 7
Wink

hola,

Ejecute por la sm35 el bacth en proceso de fondo para PFCG y funciona pero cuando voy a la pestaña Usuario el comparar usuario no se me activa.
Responder Con Cita
  #14  
Viejo 28/08/08, 06:50:39
bisonye bisonye is offline
Senior Member
 
Fecha de Ingreso: ago 2006
Mensajes: 635
Lo que tienes es una grabación de un proceso. Vuelve a hacer la grabación mediante la SHDB pero marcando el flag de proceso de fondo para que las pantallas sean iguales.

Saludos
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Reglas de Mensajes
no puedes crear nuevos temas
no puedes responder temas
no puedes adjuntar archivos
no puedes editar tus mensajes

El código vB está On
Las caritas están On
Código [IMG] está On
Código HTML está Off
Saltar a Foro


Husos Horarios son GMT. La hora en este momento es 09:00:53.


www.mundosap.com 2006 - Spain
software crm, crm on demand, software call center, crm act, crm solutions, crm gratis, crm web