Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Reg : Month and Year in my Input Screen

Former Member
0 Kudos

Hi Abapers,

I need to give only month and year (like 012007) in a field instead of date (like 01.01.200) in the Input screen ..Wat to do?

6 REPLIES 6

Former Member
0 Kudos

in the trnasfer rule or in the update rule select the Zinfo object to which you need to do conversion

in details select formula and create.

Select all functions and follow the steps below.

use the conversion function DATE_MONTH( )

Short Text

Function: Date -> Month

Functionality

Calculates the month from a specified date.

Requirements

The date must appear in the format yyyymmdd.

Parameters

DATE_MONTH (date)

Result

The result is calculated in the format yyyymm

Reward points..

0 Kudos

Use table T247 to read month name...

ATA : date LIKE sy-datum,

month LIKE t247-ltx.

date = sy-datum.

SELECT SINGLE ltx INTO month FROM t247 WHERE mnr EQ date+4(2) AND spras EQ sy-langu.

WRITE : date6(2), month, date0(4).

Reward points..

Former Member
0 Kudos

HI,

1. for MOnth, u can use the table T247

month LIKE t247-ltx.

2. For year (2006), u can use MSEG-MJAHR.

Reply back..

With Rgds,

S.Barani

Former Member
0 Kudos

Hi Arthi,

Try this code:

REPORT ZPOPDATE.

DATA: V_CODE LIKE SY-SUBRC.

PARAMETER: V_MONTH LIKE ISELLIST-MONTH.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR V_MONTH.

CALL FUNCTION 'POPUP_TO_SELECT_MONTH'

EXPORTING

ACTUAL_MONTH = '200205'

LANGUAGE = SY-LANGU

START_COLUMN = 8

START_ROW = 5

IMPORTING

SELECTED_MONTH = V_MONTH

RETURN_CODE = V_CODE

EXCEPTIONS

FACTORY_CALENDAR_NOT_FOUND = 1

HOLIDAY_CALENDAR_NOT_FOUND = 2

MONTH_NOT_FOUND = 3

OTHERS = 4.

Former Member
0 Kudos

Hi,

Declare parameter as shown below.

Parameters: p_month type FAPER.

Former Member
0 Kudos

Hi Arthi ,

Check out this function module in SE37 .

" CACS_DATE_GET_YEAR_MONTH " .

If u give input as 11.04.2008 which is today's date ,

u will get output as Month = 04 and Year = 2008 .

Thanks .