Skip to content

Instantly share code, notes, and snippets.

@dantesco
dantesco / paises.csv
Created June 21, 2016 14:14 — forked from brenes/README.md
CSV de paises, con nombre en castellano, ingles, codigo ISO y prefijo telefónico del país
nombre name nom iso2 iso3 phone_code
Afganistán Afghanistan Afghanistan AF AFG 93
Albania Albania Albanie AL ALB 355
Alemania Germany Allemagne DE DEU 49
Algeria Algeria Algérie DZ DZA 213
Andorra Andorra Andorra AD AND 376
Angola Angola Angola AO AGO 244
Anguila Anguilla Anguilla AI AIA 1 264
Antártida Antarctica L'Antarctique AQ ATA 672
Antigua y Barbuda Antigua and Barbuda Antigua et Barbuda AG ATG 1 268
@dantesco
dantesco / screen_size
Created January 14, 2015 22:15
Obtener resolución de pantalla en SAP
DATA: ref_consumer TYPE REF TO cl_gui_props_consumer,
s_metric_factors TYPE CNTL_METRIC_FACTORS.
ref_consumer = cl_gui_props_consumer=>create_consumer( ).
s_metric_factors = ref_consumer->get_metric_factors( ).
@dantesco
dantesco / hide_exec
Created January 8, 2015 21:15
Ocultar F8 en reportes
at selection-screen output.
perform INSERT_INTO_EXCL IN PROGRAM rsdbrunt using 'ONLI'.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:cfdi="http://www.sat.gob.mx/cfd/3" xmlns:tfd="http://www.sat.gob.mx/TimbreFiscalDigital" version="1.0">
<xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"/>
<xsl:template name="Requerido"><xsl:param name="valor"/>|<xsl:call-template name="ManejaEspacios"><xsl:with-param name="s" select="$valor"/></xsl:call-template></xsl:template>
<xsl:template name="ManejaEspacios">
<xsl:param name="s"/>
<xsl:value-of select="normalize-space(string($s))"/>
</xsl:template>
<xsl:template match="/"><xsl:apply-templates select="./cfdi:Comprobante"/></xsl:template>
<xsl:template match="cfdi:Comprobante"><xsl:apply-templates select="./cfdi:Complemento"/></xsl:template>
@dantesco
dantesco / sd_direction
Created March 10, 2014 21:24
Forma la dirección tal como se muestra en la transacción va03
" Obten dirección de destinatario de pedido
DATA: i_xvbadr TYPE TABLE OF sadrvb,
w_xvbadr TYPE sadrvb,
i_xvbpa TYPE TABLE OF vbpavb,
w_xvbpa TYPE vbpavb.
CALL FUNCTION 'SD_PARTNER_READ'
EXPORTING
f_vbeln = '0002862116' " pedido
@dantesco
dantesco / get_alv_exit
Created February 11, 2014 18:05
obten la salida de un alv en el reporte actual
FIELD-SYMBOLS <lt_pay_data> TYPE ANY TABLE.
DATA lr_pay_data TYPE REF TO DATA.
cl_salv_bs_runtime_info=>set(
EXPORTING display = abap_false
metadata = abap_false
DATA = abap_true ).
SUBMIT (PROGRAM)
WITH s_vbeln-low EQ space
WITH s_fkdat-low EQ space
&----
*& Report ZYSH01 *
*& Developer : Hong young sun (sapkor@yahoo.co.kr *
*& Create Date : 2006.02.27 *
*& SAP R/3 Version : 4.6C *
&----
REPORT ZYSH01.
INCLUDE ole2incl.
class ZCL_BITWISE definition
public
final
create public .
public section.
*"* public components of class ZCL_BITWISE
*"* do not include other source files here!!!
class-methods CLASS_CONSTRUCTOR .
@dantesco
dantesco / data_large_tables
Created December 3, 2013 23:28
select data from large tables
PARAMETERS : P_TABLE TYPE DDOBJNAME.
DATA : DB_CURSOR TYPE CURSOR.
DATA : LT_DFIES TYPE TABLE OF DFIES,
LS_DFIES TYPE DFIES,
STRUC_SIZE TYPE I VALUE 0,
G_PACKAGE_SIZE TYPE I.
FIELD-SYMBOLS : <XTAB> TYPE ANY TABLE.
DATA : L_REFITAB TYPE REF TO DATA.
CREATE DATA L_REFITAB TYPE TABLE OF (P_TABLE).
ASSIGN L_REFITAB->* TO <XTAB>.
@dantesco
dantesco / huge_data_to_server
Last active December 30, 2015 04:59
Obten informacion de tablas por paquetes para no sobrecagar la memoria disponible de itabs
OPEN DATASET <file name> FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
OPEN CURSOR l_c1 FOR SELECT * FROM <table NAME>.
WHILE l_c1 IS NOT INITIAL.
FETCH NEXT CURSOR l_c1 INTO TABLE <internal table> PACKAGE SIZE p_pkg.
* p_pkg is the maximum number of records to be fetched every time.
IF sy-subrc EQ 0.
LOOP AT <internal table> INTO <work area>.
TRANSFER <work area> TO <file name>.
ENDLOOP.