Ir al contenido principal

ABAP Rangos

TYPES:  tyr_vtweg TYPE RANGE OF vtweg.
DATA:
  lr_vtweg  TYPE tyr_vtweg,
  rwl_vtweg TYPE LINE OF tyr_vtweg.

* o

DATA: 
  rg_vtweg TYPE RANGE OF vtweg, 
  lr_vtweg LIKE LINE OF  rg_vtweg.


CONSTANTS:

  cl_i  TYPE LENGTH VALUE 'I',
  cl_bt TYPE LENGTH VALUE 'BT',
  cl_eq TYPE LENGTH VALUE 'EQ'.

* Canal de distribución con valor único
  rwl_vtweg-sign   cl_i.
  rwl_vtweg-option cl_eq.
  rwl_vtweg-low    'AA'.
  APPEND rwl_vtweg TO lr_vtweg.

* o

* Canal de distribución con rango de valores
  rwl_vtweg-sign   cl_i.
  rwl_vtweg-option cl_bt.
  rwl_vtweg-low    'A1'.
  rwl_vtweg-high   'A9'.
  APPEND rwl_vtweg TO lr_vtweg.

  respecto a signpuede tomar valores como:
  "I" para incluir
  "E" para Excluir

Option, puede tomar valores como:


=, EQ
Igual.
<>, NE
Diferente, no igual.
>=, GE
Mayor igual.
>, GT
Mayor que.
<=, LE
Menor igual.
<, LT
Menor que.
CP
Comprende el patrón: Se hace uso del carácter “*” o ‘+’ para crear el patrón con el que deseamos llevar a cabo la operación lógica del operando que se coloca en la variable LOW. El carácter “*” representa cualquier carácter incluyendo espacios en blanco y el carácter “+” representa caracteres sin incluir espacios en blanco.
NP
No patrón: Tiene la misma descripción de CP salvo que la operación lógica no debe incluir el patrón que se coloca en la variable LOW.
BT
Entre un valor y otro: Incluye un intervalo, se usa LOW y HIGH para saber de donde a donde se debe comparar el conjunto de datos.
NB
No se encuentra entre un valor y otro: Excluye el intervalo, es decir, trae el conjunto de datos que no se encuentra entre LOW y HIGH.
Si se necesita más ejemplos o info, (y parte de lo redactado aquí):

Comentarios

Entradas más populares de este blog

A to Z of OLE Excel in ABAP 7.4

  SAP users, both business and end users always need to download the output of a report to spreadsheet and do their analytics.   The standard excel output from a report is very simple process but it is old fashioned and the spreadsheet looks quite boring.  There is no default formatting and the users have to do all the hard work of changing the fonts, coloring the texts, marking the borders etc. Updated 16th Aug 2019  –  If you are working in non-ABAP 7.4 (below), there is complete reference program for you too. Go to the end of this article.  Thank you  Legxis  ( LeonievonK ) for the share. I acknowledge, whatever I mentioned above can be achieved in many ways programmatically. We can do it in the old traditional ABAP way but  providing multiple tabs in the spreadsheet and formatting is quite tricky with non  OLE  method. OLE = Object Linking and Embedding The high level agenda of this article is to be the  G.O.A.T.  (please google it if you do not know the full form)  of OLE Excel Gu
How to add custom field in Additional B Tab for SAP Sales Order In this article we want to explain step by step how to add custom field in SAP Sales Order transaction VA01/VA02/VA03. This time Mr ABAPGurus will give the tutorial of enhancement to add custom field in SAP Sales order. In this sample we will add new custom field for comments and customer satisfaction, this data will save into separate table from SAP Standard table ( VBAK / VBAP ). SAP provided us with ADDITIONAL TAB in the sales order transaction ( VA01/VA02/VA03 ) which allow customer to add custom fields.  T he different between ADDITIONAL A and ADDITIONAL B is the ADDITIONAL A for field which already predefine in Sales Order Header ( VBAK ) fields and ADDITIONAL B is for field that freely define. This sample we will use ADDITIONAL B because we will store data from customer satisfaction into Z database table. 1. Create one Z table using SE11 SAP Transaction code. 2.Using SE38 Transaction code and ope

VOFM

Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality 1.    Introduction 1.1   Document Purpose 1.2    This is the document helps you to create custom routine for sales order for below specific requirement: Functional description: In case of sale order with the SD document category ‘K’ or ‘L’ or ‘H’ related to an invoice, we need to fill the fixed value date (VBKD_VALDT) with the billing reference date (VBRK_FKDAT). For example: Invoice 90001111, the billing date is 22.07.2013 If we create a sale order related to this invoice, we want the fixed value date equal to the billing reference date. As per the requirement: Sap standard routine ‘103’ triggers whenever sales order is being created with reference. Sap standard routine is configured in VOFM transaction as: Sap standard routine ‘103’ has the functionality of copying the billing document header data and billing document line item data into the