viernes, 6 de mayo de 2011

Llama a sapscript

Para saber que programa es el que llama a un sapscript de la mb1b
ir al documento que tenés por la MB03, ir a la posición
correspondiente y mirar que mensaje tiene. Sino en la MB90 ejecutás todos
los mensajes (fijate como modo de proceso 1 2 o 3), y vas a tener la clase
de mensaje.

La filtrás en la tabla TNAPR, y ahí vas a tener programa de control, rutina
entry y que formulario es con su nombre.

Tambien puedes poner un break point en la funcion SSF_FUNCTION_MODULE_NAME si es
smartform o en la funcion OPEN_FORM si es sapscript.

Submit que no muestre los write de otro programa.

split i_upload2-line at p_sep1 into table i_lineas.
read table i_lineas index 2.
v_mapeo = i_lineas-line.
v_cliente = i_lineas-line+35(4).

submit zmapban01
with p_cvban = p_cvban
with p_mapeo = v_mapeo
with p_client = v_cliente
exporting list to memory
and return.

lunes, 25 de abril de 2011

Debuguear Sapscript

Vamos a la se 71 luego damos en el menu Utilities-->Active De-bugger.

martes, 8 de marzo de 2011

Programa para Buscar User Exits

REPORT ZBUSCA_USER_EXIT .
*
* Finding the user-exits of a SAP transaction code
*
* Enter the transaction code in which you are looking for the user-exit
* and it will list you the list of user-exits in the transaction code.
* Also a drill down is possible which will help you to branch to SMOD.
*
* Written by : SAP Basis, ABAP Programming and Other IMG Stuff
* http://www.sap-img.com
*

*report zuserexit no standard page heading.
tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.
tables : tstct.
data : jtab like tadir occurs 0 with header line.
data : field1(30).
data : v_devclass like tadir-devclass.
parameters : p_tcode like tstc-tcode obligatory.

select single * from tstc where tcode eq p_tcode.
if sy-subrc eq 0.
select single * from tadir where pgmid = 'R3TR'
and object = 'PROG'
and obj_name = tstc-pgmna.
move : tadir-devclass to v_devclass.
if sy-subrc ne 0.
select single * from trdir where name = tstc-pgmna.
if trdir-subc eq 'F'.
select single * from tfdir where pname = tstc-pgmna.
select single * from enlfdir where funcname =
tfdir-funcname.
select single * from tadir where pgmid = 'R3TR'
and object = 'FUGR'
and obj_name eq enlfdir-area.

move : tadir-devclass to v_devclass.
endif.
endif.
select * from tadir into table jtab
where pgmid = 'R3TR'
and object = 'SMOD'
and devclass = v_devclass.
select single * from tstct where sprsl eq sy-langu and
tcode eq p_tcode.
format color col_positive intensified off.
write:/(19) 'Transaction Code - ',
20(20) p_tcode,
45(50) tstct-ttext.
skip.
if not jtab[] is initial.
write:/(95) sy-uline.
format color col_heading intensified on.
write:/1 sy-vline,
2 'Exit Name',
21 sy-vline ,
22 'Description',
95 sy-vline.
write:/(95) sy-uline.
loop at jtab.
select single * from modsapt
where sprsl = sy-langu and
name = jtab-obj_name.
format color col_normal intensified off.
write:/1 sy-vline,
2 jtab-obj_name hotspot on,
21 sy-vline ,
22 modsapt-modtext,
95 sy-vline.
endloop.
write:/(95) sy-uline.
describe table jtab.
skip.
format color col_total intensified on.
write:/ 'No of Exits:' , sy-tfill.
else.
format color col_negative intensified on.
write:/(95) 'No User Exit exists'.
endif.
else.
format color col_negative intensified on.
write:/(95) 'Transaction Code Does Not Exist'.
endif.

at line-selection.
get cursor field field1.
check field1(4) eq 'JTAB'.
set parameter id 'MON' field sy-lisel+1(10).
call transaction 'SMOD' and skip first screen.

*---End of Program=

martes, 15 de febrero de 2011

Exportar variables a memoria SAP ABAP

Pueden servir para pasar datos de un programa a otro.
EXPORT nograba FROM nograba TO MEMORY ID 'ABC'.

IMPORT nograba TO nograba2 FROM MEMORY ID 'ABC'.

viernes, 11 de febrero de 2011

Disponibilidad de material

REPORT ZEX_AVAILIBILITYCHK .

Parameter: p_matnr like BAPIMATVP-MATNR,
p_werks like BAPIMATVP-WERKS,
p_unit like BAPIADMM-UNIT.

*Data: int_wmdvsx like BAPIWMDVS occurs 0 with header line,
* int_wmdvex like BAPIWMDVE occurs 0 with header line.

Data: int_wmdvsx type table of bapiwmdvs with header line,
int_wmdvex type table of bapiwmdve with header line,
d_WKBST like BAPICM61V-WKBST.



CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
EXPORTING
PLANT = p_werks
MATERIAL = p_matnr
UNIT = p_unit
* CHECK_RULE =
* STGE_LOC =
* BATCH =
* CUSTOMER =
* DOC_NUMBER =
* ITM_NUMBER =
* WBS_ELEM =
* STOCK_IND =
* DEC_FOR_ROUNDING =
* DEC_FOR_ROUNDING_X =
* READ_ATP_LOCK =
* READ_ATP_LOCK_X =
IMPORTING
* ENDLEADTME =
AV_QTY_PLT = d_WKBST
* DIALOGFLAG =
* RETURN =
TABLES
WMDVSX = int_wmdvsx
WMDVEX = int_wmdvex
.


Write:/ d_WKBST.

If sy-subrc = 0.

endif.


Por ABAPLOVERs
http://abaplovers.blogspot.com/2008/06/sap-availability-check-bapifunction.html

lunes, 10 de enero de 2011

Transportar Registros de tabla Z

Hay varias maneras, la primera desde la se16 vemos el contenido de la tabla,
menu--> entrada en tabla --> transportar entradas.

otra manera es desde la sm30 transporte.

otra manera es desde la se10 seleccionas la orden de transporte
le das en --> modificar
agregamos un objeto

R3TR TABU