abap

Reading data from mscomm in ABAP

时间秒杀一切 提交于 2020-01-05 03:59:05
问题 I'm trying to read data sent from serial port via MSCOMM32 object. What I got was ## . First I convert hex into string and send to COMM port: DATA : xSTX TYPE xstring VALUE '02'. DATA : sSTX TYPE string. CALL FUNCTION 'HR_KR_XSTRING_TO_STRING' EXPORTING in_xstring = xSTX IMPORTING out_string = sSTX. "this value is now # but still understood by the device SET PROPERTY OF O_OBJ 'Output' = sSTX . And then the machine attached to serial port will give a response. I read the data using this code

Bit shifts with ABAP

风流意气都作罢 提交于 2020-01-04 14:17:37
问题 I'm trying to port some Java code, which requires arithmetic and logical bit shifts, to ABAP. As far as I know, ABAP only supports the bitwise NOT, AND, OR and XOR operations. Does anyone know another way to implement these kind of shifts with ABAP? Is there perhaps a way to get the same result as the shifts, by using just the NOT, AND, OR and XOR operations? 回答1: Disclaimer: I am not specifically familiar with ABAP, hence this answer is given on a more general level. Assuming that what you

How to set values in the listbox?

◇◆丶佛笑我妖孽 提交于 2020-01-03 19:34:32
问题 I have defined a list box in my selection screen, as follows: SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE ALTITLE1. SELECTION-SCREEN BEGIN OF LINE. SELECTION-SCREEN COMMENT (30) ALCONT4 FOR FIELD L1. PARAMETERS: L1 AS LISTBOX VISIBLE LENGTH 20 MODIF ID AOD. SELECTION-SCREEN END OF LINE. SELECTION-SCREEN END OF BLOCK B2. Now I need to propose possible values for that list box, how can I do it ? 回答1: During the PBO of your screen (for selection screens, the PBO code is defined inside

Dynamically Hide ALV Columns by Data Type

别来无恙 提交于 2020-01-02 18:57:48
问题 Background: I'm using the cl_salv_table class to generate and modify an ALV. This ALV displays a table of type zpm_et_qual_notif_s , where every even number row is a delimiter field of type CHAR length 1 with names DELIM1 , DELIM2 ...etc. Since there's no reason to have delimiter columns displayed in the ALV, I'd like to remove them. Note: I left "ABAP Dictionary/Internal Structure" generic in the title because whether or not I determine the column count from the ABAP Dictionary structure or

ABAP Websocket Server XSRF Token

陌路散爱 提交于 2020-01-02 10:12:53
问题 I'm currently trying to setup a web-socket server on an SAP application server as a proof of concept. The application which is connecting to the web-socket server is not going to be a UI5 or WebDynpro application but just a middle-ware program running on a headless computer. Following a quick guide, I've setup the push channel and I have an object with the interface methods ON_START , ON_MESSAGE and etc. I'm currently testing the interface using wscat which you can get from npm . When I tried

Dynamically defined variable in ABAP

柔情痞子 提交于 2020-01-02 08:28:25
问题 Lets say I have a variable (char30) which contains a name of a Datatype and I would like to create another variable of this Datatype. Example: lv_type = 'BU_PARTNER' data: rt_value type range of ( lv_type ). Any tips how to achieve this in ABAP? Thanks! 回答1: RANGE table is just a STANDARD table with component like 'LOW', 'HIGH', 'EQ' and 'OPTION' . Using RTTS related API to create such a STANDARD table. data: lr_data type ref to data, lt_ra_string type range of string, ls_ra_string like line

一步步创建ABAP CDS view

你。 提交于 2020-01-01 17:29:10
Add AG3 or ER9 in your local SAPGUI. Open your ABAP Studio: Select the system where you will work: Click next: Once done, you can find your new project: Create your own package in SAPGUI: And add it to favourite: right click $ZCDS, create new DDL Source via context menu: Paste the following source code: @AbapCatalog.sqlViewName : 'zjerrySQLView' @AbapCatalog.compiler.compareFilter : true @AccessControl.authorizationCheck : #CHECK @EndUserText.label : 'this is description' define view Zjerrytest20160309 ( id , carrier , flight , departure , destination ) as select from spfli join scarr on scarr

How to upload a file via ABAP RFC with Webdynpro ?

三世轮回 提交于 2020-01-01 02:09:43
Xiaopeng Tan Posts: 32 Registered: 7/18/05 Forum Points: 6 How to upload a file via ABAP RFC with Webdynpro ? Posted: Nov 23, 2005 10:45 PM Reply Hi everyone, I have the follwing problem. I`m currently creating a webdynpro DC to upload files to a mySAP CRM system via RFC. The RF-module is already available at the backend side and I have imported it as a model. The ABAP module interface looks like this: *" IMPORTING *" VALUE(IV_CASE_GUID) TYPE SCMG_CASE_GUID *" VALUE(IV_FILENAME) TYPE SDOK_PROPV DEFAULT 'Case Document' *" VALUE(IV_MODELNODE) TYPE STRINGVAL DEFAULT '19' *" VALUE(IV_FILE_CONTENT

Field symbol and data reference concept in ABAP

限于喜欢 提交于 2019-12-31 22:39:13
问题 If we compare ABAP field symbols and data references with the pointer in C, we observe :- In C, say we declare a variable "var" type "integer" with default value "5". The variable "var" will be stored some where in memory, and say the memory address which holds this variable is "1000". Now we define a pointer "ptr" and this pointer is assigned to our variable. So, "ptr" will be "1000" and " *ptr " will be 5. Lets compare the above situation in ABAP. Here we declare a Field symbol "FS" and

Open SQL equivalent for ROW_NUMBER()

久未见 提交于 2019-12-31 02:25:28
问题 Is there an equivalent for the ROW_NUMBER() function for ABAP programs? This function is used as follows in SQL: SELECT ROW_NUMBER() OVER (ORDER BY SomeField) AS Row, * FROM SomeTable Where it should return the line number as the first column in the resulting rows (I'm unsure if it will be the line number in the result set or the line number in the source table). I've found that this statement can be used in SAP Business One but can't seem to find an Open SQL equivalent. Is there one or will