abap

2 errors when trying to use RFCDestination.Repository.GetTableMetadata(string tablename)

梦想与她 提交于 2019-12-11 07:29:42
问题 I know that you can get the data of a table in a SAP Server with the function RFCDestination.Repository.GetTableMetadata(string tablename) . Unfortunately I get an error when I try to execute the command. The weird thing is when I give a exisiting table I get a different error when I try something random as a tablename. Existing table: var x = dest.Repository.GetTableMetadata("TFTIT"); Error: SAP.Middleware.Connector.RfcInvalidStateException: "cannot find TABLE specified by TFTIT" Random

How to execute Report given the results of a previously executed Report in ABAP

无人久伴 提交于 2019-12-11 07:23:02
问题 My problem is the following: I have one report called Y5000112 . My colleagues always execute it manually once with selection screen variant V1 and then execute it a second time with variant V2 adding the results of the first execution to the selection. Those results in this case are PERNR . My goal: Automate this - execute that query twice with one click and automatically fill the PERNR selection of the second execution with the PERNR results of the first execution. I found out how to

Dynamic language output for structure/internal table

柔情痞子 提交于 2019-12-11 07:06:32
问题 I have a selection screen with select-options where I want to enter several information about materials, for example: material number etc. The user is also able to enter a language which the output should be in. If the user chooses english the program shall display an internal table with material number, language, material name in english. If the user enters spanish, I want the output to be in spanish. What do I have to do in order to define a dynamic structure / table which shows the

Regex CSV Replace Comma between Quotes

时光总嘲笑我的痴心妄想 提交于 2019-12-11 06:06:19
问题 We have for example a string like this: "COURSE",247,"28/4/2016 12:53 Europe/Brussels",1,"Verschil tussen merk, product en leveranciersverantwoordelijke NL","Active Enro" The Goal is to replace the comma between "merk, product" and to keep the comma like "," and ", & ," so we can split the file correctly. Any suggestions? Kind regards 回答1: First of all, you should check Understanding CSV files and their handling in ABAP article. For a one-time job, you can use this regex (but note that with

Can a READ TABLE statement be created dynamically with an arbitrary number of key field specifications?

扶醉桌前 提交于 2019-12-11 02:57:38
问题 I have the name of a table DATA lv_tablename TYPE tabname VALUE 'xxxxx' , and a generic FIELD-SYMBOLS: <lt_table> TYPE ANY TABLE. which contains entries selected from that corresponding table. I've defined my line structure FIELD-SYMBOLS: <ls_line> TYPE ANY. which i'd use for reading from the table. Is there a way to create a READ statement on <lt_table> fully specifying the key fields? I am aware of the statement / addition READ TABLE xxxx WITH KEY (lv_field_name) = 'asdf'. , but this

ABAP hard code value into SELECT and field into another field

半城伤御伤魂 提交于 2019-12-11 00:55:20
问题 It is possible in ABAP to make a select and include a hard code value and to put a value in any field. In my exemple i have to fill a range with Company code BUKRS according to VKORG so i have to do a select on TVKO like that: DATA : lt_rtvko TYPE RANGE OF bukrs. SELECT 'I' as sign 'EQ' as option bukrs as low INTO CORRESPONDING FIELDS OF TABLE lt_rtvko FROM tvko WHERE vkorg EQ p_vkorg. But i have a dump. I know a longer solution to do this, To fill manually a table of TVKO and make a LOOP to

Mark checkboxes in ALV output grid as selected

会有一股神秘感。 提交于 2019-12-10 20:24:02
问题 I am creating an ALV output grid using class cl_gui_alv_grid . One of the columns of the output table is defined as a checkbox by using the corresponding record of the fieldcatalog: ls_fcat-checkbox = 'X'. ls_fcat-edit = 'X'. For all the records of the column that contains the checkboxes, they are all set as unselected. My question is what logic can I implement in order that for some of the rows, the checkboxes to be set as selected when I display the ALV. 回答1: If you want to set the checkbox

How do I group conditions in a SELECT statement in ABAP?

血红的双手。 提交于 2019-12-10 16:36:27
问题 First off, I have no experience with ABAP, I'm operating on guesswork here. I want to add a condition to a SELECT in an existing report. The existing code looks like this: SELECT SINGLE * FROM EKPO WHERE EBELN = GT_MSEG-EBELN AND EBELP = GT_MSEG-EBELP. I want to add a condition to exclude the record if field F1 is a certain value and field F2 is 0 (both conditions must be true to exclude the record). I've tried this: SELECT SINGLE * FROM EKPO WHERE EBELN = GT_MSEG-EBELN AND EBELP = GT_MSEG

使用ABAP操作Excel的几种方法

最后都变了- 提交于 2019-12-10 16:35:51
这篇文章本来不在我计划之内,因为最近一个朋友微信上问到我这个问题,但我平时在SAP研究院工作中从没遇到过需要用ABAP操作Excel的需求,因此也没有太多技术实现细节可以分享给大家,只能泛泛写一些。 用ABAP操作Excel这个需求算是比较常见,所以Jerry希望这篇文章能起到抛砖引玉的效果,在这个话题上有多年工作经验的朋友们,欢迎留言,指出Jerry文章中不足或者错误之处。 在SAPGUI里根据关键字OLE搜索,能找到通过ABAP操作Excel的一种办法: 这段文档说的比较清楚,微软的Word和Excel这种Office应用,提供了一种所谓automation的接口,暴露的公有类的方法和属性可以被其他应用消费。 作为ABAP应用开发人员,我们通过调用OLE对象的方法CALL METHOD, GET PROPERTY,SET PROPERTY等来访问微软Word和Excel的automation接口,代码看起来像这样: 上面这个函数RH_START_EXCEL_DATA_OLE调用微软Excel的automation接口,新建一个Excel workbook,然后准备把ABAP内表里的数据写到Excel里。 你也许会问,我咋知道Excel里有哪些公有的类和方法可以被ABAP调用呢? 在Excel里点击右键,选择View Code: 打开Microsoft Visual Basic

SAP错误消息调试之七种武器:让所有的错误消息都能被定位

拈花ヽ惹草 提交于 2019-12-10 16:32:49
目录 长生剑 - SAPGUI Where Used List 碧玉刀 - ABAP调试器观察点 霸王枪 - ABAP调试器动态断点 多情环 - ABAP代码静态扫描 孔雀翎 - SAT 离别钩 - ST05 拳头 - 迷之方法??? Jerry在2018年开始用中文在微信公众号平台上写作之前,在SAP官方社区上总共写了639篇英文博客。 其中有一篇写于2013年介绍ABAP调试技巧的博客: Six kinds of debugging tips to find the source code where the message is raised 从2016年至今,在SAP社区上有超过十五万的阅读量。 实际的阅读量远远大于这个数字,因为2016年社区改版之后,文章阅读量清零了。 SAP社区在2016年改版前,有一个所谓的Gamification游戏化机制,博客每收到一个赞之后,作者会得到2点积分。这篇博客当时给Jerry赢得了不少社区积分。 该博客以一个实际例子,向大家介绍了Jerry多年ABAP编程生涯积累的6种错误消息调试方法。事实上Jerry实际工作中靠着这六种方法,对于我遇到形形色色的错误消息,几乎没有遇到调试不出抛出消息准确代码位置的情况,个人觉得这些方法还是相当管用的。 具体场景:在SE38里随便输入一个并不存在的程序名,点击Display按钮,显示一个提示消息