Dynamic date manipulation for Variant in SAP ABAP

Step1:Creating Variants for SAP ABAP programs Normal 

Variant is a concept of saving a set of input fields with values with a particular name, so that we can use the same set of inputs next time, the below is the example of creating variants in SAP ABAP programs.

Create a program with a selection-screen.

REPORT ZSAPN_DYNAMICDATE.
DATA LV_DATUM TYPE DATUM.
PARAMETERS P_DATE TYPE DATUM.
SELECT-OPTIONS S_DATE FOR LV_DATUM.

Creating variants in SAP ABAP reports

Provide some input values, click on save button.

Creating variants in SAP ABAP reports

Provide variant name, description and save.

Creating variants in SAP ABAP reports

How to use variant in SAP ABAP programs

Go to the program selection screen, you will find variant icon, click on variant icon.

Creating variants in SAP ABAP reports

You will find list of variants available for the program, double click on any variant, the values will be populated to screen automatically.

Creating variants in SAP ABAP reports

Creating variants in SAP ABAP reports

Step2:Dynamic date in variant for parameters Normal 

Go to report selection screen.

Provide some input values, click on save button.

Dynamic date in variants in SAP ABAP

Press F4 on selection variable input of parameter date,select D:Dynamic Date Calculation, enter.

Dynamic date in variants in SAP ABAP

Press enter, press F4 on name of variable, double click on  current date +/- ??? days.

Dynamic date in variants in SAP ABAP

A pop up will open enter -1, means current date -1..(todays date -1, changes dynamically everyday).

Dynamic date in variants in SAP ABAP

Save the variant, go to report selection-screen select variant by clicking on variant, you will find yesterdays date on selection screen, this will changes dynamically every day.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ChampaignWolf

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值