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

jueves, 6 de enero de 2011

vencimiento neto en bsid

transaccion fbl5n
Para calcular el vencimiento neto de la tabla bsid para partidas abiertas
se suma zbd3t o zbd2t o zbd1t dependiendo la ultima que tenga datos
si la 3 tiene se pone esa si no la 2 esa se suma a la fecha base para
el calculo de vencimiento zfbdt.

miércoles, 5 de enero de 2011

Bajar una tabla interna a Excel

DATA texto(30) TYPE c.
CONCATENATE 'c:\' sy-uzeit 'EXCEL.DAT' INTO texto.

CALL FUNCTION 'WS_EXCEL'
EXPORTING
filename = texto "'c:\EXCEL.DAT'

TABLES
data = i_t."data = i_sel.

IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.