Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all 8332 articles
Browse latest View live

how to get holidays info on SQ02 -

$
0
0

Hello everyone

I would like to find if that day is a holiday or working, I tried with the FM HOLIDAY_CHECK_AND_GET_INFO with this code:

 

but I do not find anything, I was expecting to Sunday the flag X (and other days..)

 

please help me

 

thanks in advance

---------------

 

CALL FUNCTION 'HOLIDAY_CHECK_AND_GET_INFO'

  EXPORTING

    DATE                               = ZBLD_RDT_CON_RDA-DATUM

    HOLIDAY_CALENDAR_ID                = FABKL

    WITH_HOLIDAY_ATTRIBUTES            = ' '

  IMPORTING

    HOLIDAY_FOUND                      = HOLID

* TABLES

*   HOLIDAY_ATTRIBUTES                 =

  EXCEPTIONS

    CALENDAR_BUFFER_NOT_LOADABLE       = 1

    DATE_AFTER_RANGE                   = 2

    DATE_BEFORE_RANGE                  = 3

    DATE_INVALID                       = 4

    HOLIDAY_CALENDAR_ID_MISSING        = 5

    HOLIDAY_CALENDAR_NOT_FOUND         = 6

    OTHERS                             = 7

          .

IF SY-SUBRC <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.


Virtual Private Cloud with VPN Access for SAP Trials provided as Virtual Appliance

$
0
0

In this tutorial I’m showing all the steps required to set up a virtual private cloud (VPC) on AWS with VPN access for your trial instances provided as virtual appliances by the SAP Cloud Appliance Library. The proposed setup consists of a VPC with internet gateway, an Open VPN access server in the public subnet of the VPC, and your trial instance in the private subnet of the VPC, as illustrated in the drawing below.

Remark: Alternatively, you may follow this tutorial which shows a much quicker, but less secure approach.

VPC_landscape_01.PNG

Disclaimer

 

Please keep in mind that this is just a proposal to get you started quickly and only one variant how to realize such a scenario in a fairly secure way. There are a lot more installation and configuration options which are not shown below. Thus, this might not be the perfect setup for your personal use case. So please also consider alternative scenarios explained in the VPC documentation. In addition, we always recommend to set up a billing alert for your AWS account to avoid unpleasant surprises.

 

Section 1: Creating the VPC with public and private subnet

 

As a prerequisite for this section I assume that you already have a valid Amazon Web Services (AWS) account. Otherwise navigate to the AWS homepage and sign up.

  1. Sign in to the AWS console of your AWS account: https://console.aws.amazon.com/console/home
  2. Navigate to the VPC Dashboard and select the region US East.
  3. Click on the Start VPC Wizard button.
  4. Select VPC with a Single Public Subnet Only and click Continue.
    VPC_01.PNG
  5. On the next screen use the default settings (VPC: 10.0.0.0/16; public subnet: 10.0.0.0/24) and click Create VPC.
    VPC_02.PNG
  6. After your VPC has been created navigate to Route Tables in the navigation pane and click on the custom route table associated with your subnet (Main attribute = No).
  7. Besides the local route the custom route table of this public subnet contains a route enabling traffic destined for an IP address outside your VPC via the associated internet gateway.
    route_table_01.PNG
  8. You can verify that the main route table of your VPC only enables the local route but no route to the Internet.
    route_table_02.PNG
  9. Navigate to Security Groups in the navigation pane and click on the default VPC security group and delete all existing inbound and outbound rules and apply the rule changes.
  10. Navigate to Subnets in the navigation pane and click Create Subnet.
  11. Create a private subnet within your existing VPC, choose the same availability zone as your public subnet, but define a separate CIDR block (private subnet: 10.0.1.0/24).
    privateSubnet_01.PNG
  12. Verify that the private subnet is using the main route table which only contains the public subnet as local destination.
    privateSubnet_02.PNG

 

Section 2: Launching the OpenVPN server into the public subnet of your VPC

 

  1. Navigate to the VPC Dashboard and verify that you are still using the region US East.
  2. Click the Launch Instance button and select the Classic Wizard.
  3. Navigate to the AWS Marketplace tab and search for OpenVPN.
    VPNserver_01.PNG
  4. Choose the OpenVPN Access Server, navigate to the Launch with EC2 Console tab and hit the Launch with EC2 Console button in the region US East.
    VPNserver_03b.PNG
  5. Review the AMI details and click Continue in the wizard.
  6. In the Instance Details dialog choose T1 Micro as instance type and select your public subnet (e.g. 10.0.0.0/24) in the EC2-VPC tab. Finally, hit the Continue button.
    VPNserver_05.PNG
  7. On the next screen use the default values and assign a static IP (e.g. 10.0.0.99) to the eth0 network adapter of your OpenVPN server. Then hit the Continue button.
    VPNserver_06.PNG
  8. Review the default storage settings and hit the Continue button.
  9. In the tags dialog enter OpenVPN server as value for the Name key and hit Continue.
  10. On the next screen select Create a new key pair, enter a name and click the Create & Download your Key Pair button. Store this key pair of your instance in a safe place.
    VPNserver_09.PNG
  11. In the Configure Firewall dialog select Create new Security Group, name it OpenVPN and add inbound rules for TCP port 22 (SSH), TCP port 443 (HTTPS for the OpenVPN WebUI) and UDP port 1194 (UDP based VPN) as shown in the screenshot.
    VPNserver_11.PNG
    Important remark: We even recommend to restrict access to these ports to trusted IP addresses, i.e. the IP address range of your company or your ISP.
  12. Hit the Continue button, review your launch configuration and hit the Launch button.
  13. Navigate to Instances in the navigation pane, wait until your instance launched successfully.
  14. Select your OpenVPN server instance and use the Actions menu to Change the Source/Destination check to disabled.
    VPNserver_13.PNG
  15. Now navigate to Elastic IPs in the navigation pane, click the Allocate New Address, and select EIP used in VPC.
    eIP_01.PNG
  16. Select the new EIP address, hit the Associate Address button and select the instance ID and IP of your OpenVPN server. Finally, confirm with Yes, Associate.
    eIP_03.PNG

Section 3: Connecting to your OpenVPN server using SSH

 

  1. Extract the private key from your openVPN instance key pair that you downloaded during instance creation. Use PuTTYgen or a similar tool to import the key pair and save the private key as ppk file.
    SSH_01.PNG
  2. Download and install an SSH client like PuTTY for your OS.
  3. Open your SSH client, enter the Elastic IP of your openVPN server and load the exported private key file for authentication in the SSH-Auth section.
    SSH_03.PNG
  4. Enter openvpnas as Auto-login username in the Connection-Data section and hit the Open button to log into your openVPN server.
  5. Proceed with the configuration of the openVPN server using the default settings. For more information consult the corresponding Quick Start Guide.
    SSH_04.PNG
  6. Now define a password for your openVPN admin user (default was openvpn) by running sudo passwd openvpn (or using your username) in the secure shell.
  7. Open the Admin WebUI using https://YourEIP/admin and log in with you admin user.
    openVPN_01.PNG
  8. Navigate to the Server Network Settings and verify, that your elastic IP corresponds to the Hostname setting.
  9. Navigate to the VPN Settings and enter both subnets in the Routing section (e.g. 10.0.0.0/24 and 10.0.1.0/24).
    openVPN_03.PNG
  10. Now you are done with the basic configuration of your OpenVPN server, log out of the Admin WebUI and exit the secure shell.
    Remark: For security reasons you can also create non-admin VPN users in the User Management section of the Admin WebUI.
  11. Download and install an OpenVPN client for your OS (if you don’t already have one).
  12. Run the OpenVPN client and test your VPN connection by entering the Elastic IP of your OpenVPN server and log on with your VPN user (e.g. openvpn).
    openVPN_04.PNG
  13. Verify that the VPN connection to your VPC has been established successfully.

Section 4: Launching the trial instance into the private subnet of your VPC

 

As prerequisite for this section I assume that you already purchased your trial solution in the SAP Store and registered your AWS account in the Test Drive Center for the SAP Cloud Appliance Library (CAL TDC) as shown in our video tutorial.

  1. Enter your CAL TDC account and  navigate to the Solutions tab. Activate the trial solution you want to instantiate (if not already done) and hit Create Instance.
  2. In the Define General Properties dialog enter a name, select AWS (Amazon) as IaaS provider, choose us-east-1 as region and select Access From Corporate Network and choose your private subnet (e.g. 10.0.1.0/24).
    CAL_instance_01.PNG
  3. In the Configure Virtual Machine dialog review the Virtual Machine Size (choose the recommended size) and the access points of your instance (defaults should be fine unless you have specific requirements).
  4. In the next dialog set the master password for your trial instance (used for several system users as documented in the corresponding user guide).
  5. In the following dialogs you can configure a schedule (optional) and complement your cost forecast (optional).
  6. Finally review your trial instance properties and hit the Finish button.
    CAL_instance_02.PNG
  7. Store and download the key pair of your trial instance in a safe place. As shown above you can export the private key of your trial instance with PuTTYgen as ppk file.
  8. Wait until the initial provisioning process finished and your trial instance is up and running.
  9. Click on your running trial instance and copy the IP address to your clipboard. For your convenience, add the IP to hostname mapping to your local /etc/hosts file. This enables you to use the hostname of your trial instance in SAP GUI or other local clients.
    hostname_etc_hosts_01.PNG


That’s basically it! Use your VPN client to connect to your VPC and work with your trial instance. For example you can now SSH into your trial instance as root using its private key file or connect via SAP GUI with one of the predefined SAP users. Of course, you can deploy additional systems into the private subnet of your VPC if required.

Function Module for Update characteristics directly in configuration to equipment in IE02

$
0
0

Hi,

Please help with standard SAP function module  which update's characteristics directly in configuration to equipment in IE02.refer the attached file.

 

HM_FactoryNumber

HM_HW_REVISION

HM_FW_SW_REVISION

User Exit to Change 'Assignment Field' while uploading Bank statement using FF_5

$
0
0

Hi Experts,

 

We are uploading  bank statement using tcode FF_5. It creates BDC of FB01. then we process it via SM35. Its a country specific bank statement (Hungary). Now while processing BDC we found that document header text (BKTXT) and Assignment (ZUONR) field is filled with the combination of two keys of table FEBEP.

 

Screen shot of BDC

 

Screen having document header text:

BKTXT.jpg

Next Screen having Assignment

 

ZUONR.jpg

These both fields are the combination of FEBEP-KUKEY -Short key (surrogate) and FEBEP-ESNUM -Memo record number (line item number in bank statement).

Both fields are getting filled inside the standard program RFEBBU00 (This program creates BDC)

 

bktxt1.PNG

 

zuonr1.PNG

 

Now user wants 'posting date' in the Assignment field. Functional has changed the configuration so while doing manually via FB01 , posting date gets populated in Assignment field but While uploading via FF_5 this standard report gets called and it populates the key combination.

 

I am working on SAP 4.7 .

Is these any user exit or sap note for this info.

Please help me. if anyone has any idea that would be helpful.

 

Regards,

Ashish

Can 'Table' still be used in Function Module?

$
0
0

It seems that 'Table' is obsoleted. Changing is the one which replaces Table.

But some BAPIs are still using Table parameter even if they are standard BAPIs.

Accounting Clerk Print in F110

$
0
0

The Accounting Clerk is not getting printed on the Payment Advice form . This is SAP STANDARD PROGRAM RFFOAVIS_FPAYM and In Include RFFORI99  FM CORRESPONDENCE_DATA_BUSAB fetched the data .

 

I debugged the program :

1) When it fetches the data for the run , all the fields are populated in the working structure (reguh ) but not the BUSAB field ( Acc Clerk Number ). Can anyone figure out why ?

 

2) During Debugging , i edit the field and put some value so that it atleasts work and get the data into the structure ( for acc clerk data ) , but i dont see any data being populated ?

 

Pls if anyone has come across such problem . pls let me know how can we solve this . Pls HElp !!

Consumption and Lgort

$
0
0


Hi Friends,

 

I need a function or BAPI which is showing  material comsumption and lgort .

I found CONSUMPTION_READ_FOR_MM, but there is no any lgort.

 

Another solution , I used  thable Aufm in my code. But very slow ...

 

A pieces of my code :

 

SELECT mblnr budat bwart matnr lgort menge meins FROM aufm

 

APPENDING CORRESPONDING FIELDS OF TABLE iaufm

 

FOR ALL ENTRIES IN t_mara_matnr

 

WHERE budat IN s_datum

 

AND matnr EQ t_mara_matnr-matnr

 

AND mjahr EQ lv_yil

 

AND lgort IN zlgort

 

AND ( bwart EQ '261' OR bwart = '262' ) .

 

What do you think of it ?

How can I more fastly ?

 

Kind Regards

Alignment problem

$
0
0

Hello Experts,

 

I am working on scripts, i am getting all fields value.

i have problem in alignment

i am not able to drawn table.

is there any standard alignment which can help me creating a script.

 

can any one help me this scenario.

 

Regards

Prathmesh Rane

script.JPGscipt1.JPG


Spool ID not generated in SAPSCRIPT, Characters issue

$
0
0

Hello Experts,

 

Just need some of your views on printing multiple language in SAPCRIPT. Having issues on characters. It's my 1st time to create this, so I'm really having some hard time understanding the concept & available reading materials.

1. No spool id is generated when executing either open_form & close_form.

2. What are the printer setup that needs to be checked? What needs to be checked in SPAD and SCOT? How to check CODE PAGE?

3. I am sending the pdf attachment thru mail. But odf non-English characters (i.e. Japanese, Taiwan) are messed up.

 

Hope someone can help me with this. Thanks.

 

Bale

delete statement error.

$
0
0

Hi,

    In final internal table am having 10 records,

 

mat no           ebeln           ebelp           bwart           grund           menge

 

1                    013445          1               541               18               25

 

2                    013445          1               101               18               25

 

3                    013445          1               542               18               25

 

4                    013445          1               542               18               25

 

5                    013445          1               544               18               25

 

6                   013445           1               543               18               25

 

above records i want to separate the values based on bwart..so am using

 

DELETE GT_FIN_102 [] WHERE BWART_I NE '102' OR BWART_I NE '544' .

DELETE GT_FIN_101 [] WHERE BWART_I NE '101 OR BWART_I NE '543' .


but it deletes all the internal values by using OR condition.

May i know how to use delete statement with multiple conditions.????/

OO ALV Cell Merge Problem when editable fields

$
0
0

Hi there!

 

I'm using OO ALV ( CL_GUI_ALV_GRID ) and experiencing a strange problem.

 

I'm interested in the cells merging functionality of ALV, when i sort data for a specific field.

It works fine but only if i do not set any field as editable ( lvc_s_fcat-edit = 'X' ).

For some reason ALV loses some of its functionality when you set a field as editable.

I've noticed it also with the functionality of expanding/supressing data when using subtotals.

If any field is set as editable then subtotals come always expanded, you cannot supress them...

 

Has anyone else experienced somethng like this before? Any help will be appreciated!

 

BR

George Zervas

Object oriented programming in abap?

$
0
0

Hi exports,

     i am new to ooabap please share me any material and suggestion tell me.

 

Thanks and regrads

B.Achuth kumar

How to move the data from application server to FTP & how to download the data in background

$
0
0

Hi Friends...

 

 

Any one can help me.. I have moved the data to the application server in the background.. my problem is that, that data has to download to the presentation server by the scheduling in background. this is my requirement. I am unable to download the data directly in the background.

so that's why sap has given cg3y. I am using cg3y transaction. but client is not agree with that. so please help me.

 

so somebody has suggested me. you can achive this, through the FTP in background. but I don't have an idea about FTP. So any one can help me.

this is very urgent for me..  I have searched in the scn I got the below link.. I am thinking to  follow  below link . is this correct way.or any other way?  please help.me.. its urgent for me...

 

 

http://wiki.scn.sap.com/wiki/display/ABAP/FTP+file+transfer+in+Background

Cannot trigger second page in sapscript

$
0
0

Hello experts.

 

I have a sapscript with 2 pages. Although i've set nextpage in page1 when i print at my program or print preview at se71 page2 does not trigger. What should i change to trigger page2.

 

 

Regards

How to Hide Empty Column In SAP Query (SQ01)

$
0
0

I was crated a report in sq01 based on business requirements , but there are some fields without any content , in sq01 if you select one of output fields in the right side of the screen in the left side you can see  "List Fields" T in the list fields there is a check box , the name is "Only display field if <> 0 " , but when i check it, it doesn't work  , guys is there any one to help me to eliminate column without content , in the result of sap query (sq01) ??


Error log for FM POST_DOCUMENT

$
0
0

Hi Experts,

I have used 'POST_DOCUMENT' FM for uploading recurring documents, but there is no return structure fot the FM.

Is there any way I can get the error log?

 

I read somewhere to use 'BAL_DSP_LOG_DISPLAY' for getting the log.

Please suggest what is the best solution to get the return messages, without which the implementation is futile.

 

Best Regards and thanks,

Sumit

Read a file in a server and create mail

$
0
0

Hi experts,

 

I have a csv file in an AL11 BW server as following:

 

Sans titre.png

 

Sans titre 2.png

 

I would like to add some abap instructions into a BW abap to program to read the second line of this file and then create a dynamic address mail with the number or name present in the second line in this format name recovered@gmail.com .

 

So in my case that will be 1200@gmail.com.

 

Is that possible?

 

Thanks

Amine

Copy standard bapi to Zbapi in the same standard package

$
0
0

Dear SAP,

 

I wanted to copy a standard bapi into Zbapi. As soon as i do this it is asking for access key.

Is it ok to use the access key and create??

Is there any exit to do this ?

 

Please help me in this regard.

 

The Bapi name  /AFS/BAPI_SALESORD_CREATEFDATA

 

from this Bapi, i want to create the ZBAPI.

 

Regards,

Arati

Allignment Problem In Class CL_BCS

$
0
0

Dear All,

 

I am using class CL_BCS to trigger mail. Whenever I am sending mail to other server (for example : gmail) the alignment of the body is irregular. Can anyone help me regarding this issue ??

 

Thanks and regards,

Megh

String templates

$
0
0

I just played around with the string tempülates now available in one of our updated systems. So i tried

 

 

 

  type_descr = cl_abap_typedescr=>describe_by_data( s ).

  CASE type_descr->type_kind.

    WHEN cl_abap_typedescr=>typekind_time.
      r = |{ s time = user }|.

 

 

Where s is an importing parameter of a method having type CLIKE

 

but i got the error "Format directive TIME cannot be used on the embedded expression".

 

Inserting a helping variable

 

ltime type t

 

and

 

ltime=s;

r = |{ ltime time = user }|.

 

solves this, but thats exactly what i want to avoid: a helping variable just for type casting

 

Is there no way to solve this without a helping variable?

 

Please don't give hints to use concatenate or write into, i know these and i know how to use this. My intention is to get experience with string templates.

 

Viewing all 8332 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>