• Home
  • About me
  • FALV
  • ALV Grid in the nutshell
    • Basic Information
    • Field catalog
  • Articles
    • Tricks
    • FALV (Fast ALV Grid)
    • ALV Grid in the nutshell
    • Tips
    • How to...
    • For beginners
    • Thoughts
  • By Topic
    • ALV
    • ALV OO
    • SALV
    • GOS
    • Selection screen
    • Purchase Requisitions
    • Purchase Orders
    • Attachments
    • Others
    • Characteristics
    • Sample Programs
    • ZIP
    • OLE
    • Mails
    • Routings
    • EWB
    • Excel
  • Keywords
  • RSS
  • Download
  • Home
  • Articles
  • How to...

F4 Help for external date

Details
Łukasz Pęgiel
How to...
24 April 2013
Hits: 13998
Tags: PERIOD_AND_DATE_CONVERT_OUTPUT , F4_DATE
In one of the previous articles I described how to Convert date to and from external date type, so we can display in grid or in screen field properly formated date. Today I will show how to create a F4 help for such external date. I will use today FM 'F4_DATE' to show the date popup and already know FM 'PERIOD_AND_DATE_CONVERT_OUTPUT' to convert internal date to external type.

Importing:

IM_DISPLAY TYPE CHAR1  - Display only? (no selection)
IM_ELPEI TYPE TPRG-PRGBZ (OPTIONAL) -  External date type

Exporting:

EX_EEIND TYPE RVDAT-EXTDATUM   - External date
EX_ELPEI TYPE TPRG-PRGBZ       - External date type

Add a comment
Read more ...

Save variant for single selection screen subscreen

Details
Łukasz Pęgiel
How to...
23 April 2013
Hits: 24757
Tags: RS_REFRESH_FROM_SELECTOPTIONS , RS_ISOLATE_1_SELSCREEN , RS_CREATE_VARIANT , RS_CHANGE_CREATED_VARIANT
When building a program with multiple selection screens sometimes it may be needed to save the variant with entries only for one of the subscreens and not for the others. If you want to do that you have to firstly use FM 'RS_REFRESH_FROM_SELECTOPTIONS' to get all fields and values for all select-options, then you need to use FM 'RS_ISOLATE_1_SELSCREEN' to get the fieldnames for selected subscreen. When you have this data you can easily filter fileds and it's values to this which you have on your subscreen. After that run FM 'RS_CREATE_VARIANT' to create a new variant, if variant exists and you want to overwrite it then you have to use 'RS_CHANGE_CREATED_VARIANT'.  Few lines and you can use this in many developments.
 
Importing parameters:

I_DYNNR TYPE SY-DYNNR - Current Screen Number
I_VARNAME TYPE RSVAR-VARIANT - Variant Name
I_VARTEXT TYPE VARIT-VTEXT - Program variant short text

Add a comment
Read more ...

Delete Routing - piece of cake

Details
Łukasz Pęgiel
How to...
18 April 2013
Hits: 23254
Tags: CP_CC_S_LOAD_COMPLEX_BY_TSK , CP_CC_S_DELETE_BY_TSK , CP_CC_S_SAVE , CP_CL_TSK_UNLOCK , BAPI_ROUTING_DELETE? , CP_CC_S_DELETE_BY_MTK

Not once, not twice I've search for a solution to do changes in routings (task lists) in some wise way. I hate BDC but in this case I thought that there is no other solution. Fortunately I was wrong ! While reading one of the post asking about same thing one of the users has mention something really nice - SAPNote 488765 "Do-it-yourself EWB programming". This note shows how to use FM used in CEWB, so we can create/change/delete bom and routings. The example available in the note shows how to change an routing operation description. The rest you have to figure out alone but once you start to use the functions or you'll check "where used" then it became quite easy (but not less time consuming).  When you find the function you're seeking then it's piece of cake.

It was like that also with delete routing function which I share with you today. There is no BAPI_ROUTING_DELETE (yet), so firsty we had to load the task to EWB memory with 'CP_CC_S_LOAD_COMPLEX_BY_TSK' ,then it's time to set deletion indicator in MAPL ('CP_CC_S_DELETE_BY_MTK') and in PLKO ('CP_CC_S_DELETE_BY_TSK'). At the end we have to save the changes  with 'CP_CC_S_SAVE' and dequeue task with 'CP_CL_TSK_UNLOCK'. If you need you may also delete the operations but in my opinion this is not needed here.

Add a comment
Read more ...

Creating editor for dynamic code (SE38 like)

Details
Łukasz Pęgiel
How to...
17 April 2013
Hits: 17381
Tags: SYNTAX-CHECK , RS_TOOL_ACCESS , EDITOR_TABLE_WITH_STATUS , SAPGUI_SET_FUNCTIONCODE , PRETTY_PRINTER

I had a thought one day to use a code saved in database table for easy change of some calculation rules and I've prepared code to run SE38 like editor for such code. Maybe some of you also had such need, so today I will explain briefly how to do this. I will use FM 'EDITOR_TABLE_WITH_STATUS' to display an editor which you know from SE38/SE80 , 'SAPGUI_SET_FUNCTIONCODE' for setting OK_CODE for editor, 'PRETTY_PRINTER' to make our code looks readable. I will also use one trick that allows you to assign data which is available in calling program but not in our function. But before we need to prepare our own GUI status with some basic buttons like 'Patern' or 'Pretty Printer'.

Add a comment
Read more ...

Download CV01N/2N/3N documents to PC

Details
Łukasz Pęgiel
How to...
14 April 2013
Hits: 38617
Tags: CVAPI_DOC_GETDETAIL , CVAPI_DOC_CHECKOUTVIEW , SCMS_DOC_READ , SCMS_BINARY_TO_XSTRING , SCMS_XSTRING_TO_BINARY

You might have a task to use or download one or all files attached to document saved via CV01N transaction. This is not a big deal really, you just need to use some FMs available in standard of SAP like  'CVAPI_DOC_GETDETAIL', 'CVAPI_DOC_CHECKOUTVIEW' or  SCMS_DOC_READ'.  These FMs allows you the check the details of document, check it and then read its content. Of course sometimes you'll have to zip the files before the downloading and here in my code I used method "zip" for which code you can find here.  While reading the code you may also find another Z-method called "get_filename_from_path", its code is posted here. The method I'm posting bellow allows you to choose if during download of files from document you want to zip them all together into one zip file or if you want to zip them separatelly. In table ET_FILES you'll find all files that were attached to document, field "UPDATEFLAG" will be set to 'D' if file was succesfully downloaded to PC. If you don't want to download the file but you want to get it for futher use you'll have to request ET_XSTRING table. In other case do not request this parameter as it is a sign for method that you don't want to donwload the files.

Types:

TT_RA_FILENAME type range of CVAPI_DOC_FILE-FILENAME.
TT_XSTRING type table of xstring.

Importing:

I_DOKAR TYPE DRAW-DOKAR ->Document Type
I_DOKNR TYPE DRAW-DOKNR ->Document number
I_DOKTL TYPE DRAW-DOKTL   ->Document Part
I_DOKVR TYPE DRAW-DOKVR  ->Document Version
I_DOWNLOAD_DIRECTORY TYPE STRING -> path to download the fiels
I_ZIP_FILES TYPE C OPTIONAL -> mark it 'X' if you want to zip the files before downloading
I_ZIP_SEPARATELY TYPE C OPTIONAL -> mark it 'X' if you want to zip each file found in document separately
I_NAME_FILTER TYPE TT_RA_FILENAME OPTIONAL -> Range for filter filenames - select which documents you want to download
I_FILENAME TYPE CSEQUENCE OPTIONAL -> filename for zip - used if you zip all files into zip container

Exporting:

ET_FILES TYPE CVAPI_TBL_DOC_FILES -> Table with all files found in document 
ET_XSTRING TYPE TT_XSTRING -> TT_XSTRING -> Table of xstrings (each file in separated line)

Exceptions:

ZIP_ERROR -> Error while zipping
DOCUMENT_ERROR -> Error while reading document

Add a comment
Read more ...

ZIP a file using ABAP

Details
Łukasz Pęgiel
How to...
13 April 2013
Hits: 29573
Tags: CL_BCS_CONVERT , CL_ABAP_ZIP , SCMS_STRING_TO_XSTRING

Although our connections are now so fast we may still need sometimes to compress data before attaching to mail or downloading into PC. SAP has possibilities to ZIP the content in class CL_ABAP_ZIP and I've used this class to create a method to simplify the process of zipping.

First of all class CL_ABAP_ZIP is zipping xstrings so I'll provide you the possibility to pass not only xstring variables but also a string, soli_tab or solix_tab. These are commonly used type when coding files content.

Add a comment
Read more ...

Get filename and extension from full path

Details
Łukasz Pęgiel
How to...
13 April 2013
Hits: 37019
Tags: FILENAME , EXTENSION

I guess all of us often had to work with files in ABAP usign some of available FM like 'GUI_UPLOAD', 'GUI_DOWNLOAD' etc. When doing so sometimes there is a need to display in ALV the filename with or without extension . There are plenty of FM that helps to do so but the have one disadvantage -> they base on 3 digit extension and sometimes they have limited path size.

But where stadard SAP cannot help you, then you have to helpyourself with ABAP. There is a really simple way to split filename/extension without any restrictions known from standard FM. Here is a code for a method, but you can use it also to create form or FM. 

Add a comment
Read more ...

Convert date to and from external date type

Details
Łukasz Pęgiel
How to...
11 April 2013
Hits: 17292
Tags: PERIOD_AND_DATE_CONVERT_OUTPUT , PERIOD_AND_DATE_CONVERT_INPUT

You've seen many times that in standard SAP transactions the dates can be presented in days, weeks and months although in database it's saved as normal DATS type. For sure in same table you can find the field called "External date type" which is used to convert standard date to external one. If you're designing a program in which you want to use same functionallity then FM 'PERIOD_AND_DATE_CONVERT_OUTPUT' and 'PERIOD_AND_DATE_CONVERT_INPUT' comes with a help.

Add a comment
Read more ...
Page 6 of 6
  • Start
  • Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Next
  • End


Łukasz Pęgiel
SAP TechEd 2016 ALV Grid in the nutshell Field catalog - tech FIELDCATALOG RESET REJ ALLOWED APPEND USER OBJECTS GUI ALV GRID FALV ALV GRID ZDEMO EMPHASIZE COMP REQUIREMENT DATE OUTLOOK APPLICATION READ GROUP Field catalog - edit mask ESDUS INTTYPE Battleships game two players LOAD COMPLEX TSK SALV CONTROLLER METADATA Field catalog - key sel ADT FRIEND CTMS DDB SET VALUE INTERNAL ABAP Code Retreat Tychy 2019 - Organizer Recap SAVE SETTINGS COMMIT WORK LVC FCAT ABAP in Eclipse Field catalog - no convext Field catalog - fieldname How to select proper configuration entry FILL MDLB FROM EBAN GOS SERVICE TOOLS GTMOVE LINKED Field catalog - col pos not allowed ALV GRID IN THE NUTSHELL REUSE DISPLAY PRINTOUTS Zipping in IZArc with ABAP directly on PC SEARCH FREE SESSION CHECK Range to search in lower case fields ONLINE HAS VALUES ABAP ELEMDESCR ABAP Extensions - Automatic Logon Enhanced MB51 Part 5 - Export from MB51 CFIELDNAME COMPONENTS MAINTAIN Download CV01N 3N documents to PC MMIM REP CUST PURCHASE ORDER FIORI Why I like to code in ABAP in Eclipse ZCL LAYOUT - layout settings FRONTEND
  • Laserowe usuwanie blizn Tychy
  • Laserowe usuwanie zmarszczek Tychy
  • Salon Kosmetyczny Tychy
  • Trycholog Tychy
  • Wypadanie włosów Tychy
Tweets by abapblog

Eclipse Plugins for ABAP

ABAP Favorites

Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client

ABAP ADT Extensions

Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client

ABAP Quick Fixes

Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client

 

Latest Articles

  • ABAP in Eclipse - Install, Configure, Use, and Enhance Your ADT
  • ALV Grid in the nutshell: Field catalog - col_id - ALV control: Column ID
  • ALV Grid in the nutshell: Field catalog - dfieldname – Fieldname for column group
  • ALV Grid in the nutshell: Field catalog - Hotspot - ALV control: SingleClick-sensitive
  • ALV Grid in the nutshell: Field catalog - sp_group - Group key
  • ALV Grid in the nutshell: Field catalog - domname - Domain name
  • ALV Grid in the nutshell: Field catalog - reprep - ALV control: Value is selection criterion for rep./rep.intf.
  • ALV Grid in the nutshell: Field catalog - reptext – Heading
  • ALV Grid in the nutshell: Field catalog - lowercase - Lowercase letters allowed/not allowed
  • ALV Grid in the nutshell: Field catalog - intlen - Internal Length in Bytes
  • Downloading Exchange Rates from NBP (National Bank of Poland)
  • Downloading Exchange Rates from Central Bank of Turkey
  • ABAP Extensions - Automatic Logon
  • ALV Grid in the nutshell: Field catalog - inttype - ABAP data type (C,D,N,...)
  • ALV Grid in the nutshell: Field catalog - datatype

Most Read

  • Create XLSX/MHTML file from internal table in background
  • Refresh ALV GRID and keep position and current cell
  • Create XLSX file from internal table in background v2
  • FALV (Fast ALV Grid)
  • ATC Pseudo Comments list
  • Call standard F4 search help with customized parameters
  • Dynamic GUI STATUS & TITLE with ABAP code
  • Create fieldcatalog from internal table
  • Link Attachments of Purchase Requisition to Purchase Order
  • GOS - How to add business documents at creation of object
  • Endless loop in BADI ME_PROCESS_PO_CUST
  • Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 3 - Chart Data and render
  • How to access private or protected data and methods of CL_GUI_ALV_GRID
  • Subtotal lines of ALV GRID OO as content separator
  • Popup with multi-select ALV
feed-image Feed Entries

Latest Comments

ABAP code and articles provided on http://abapblog.com, if it is not statet otherwise, were created by Łukasz Pęgiel. You can use the code in your SAP instance for commercial and non-commercial use without any warranty from side of the author. You cannot sell the code as a full program or a part of it.
Replicating of the articles and code is prohibited unless the agreement of the author is given to you. 

Bootstrap is a front-end framework of Twitter, Inc. Code licensed under MIT License. Font Awesome font licensed under SIL OFL 1.1.