Application Development and Automation 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: 
Read only

Month Year format for parameter refer T.code MC(A

Former Member
0 Likes
1,700

Helloooooooooooo

i think nobody understand my question . u should go transaction code. MC(A u see

hi

I've some problem in user selection parameter, I want DD.YYYY format in paratermter .

for example.

( go to MC(A Transaction code in that screen we can see Period to analyze table, under this tab v see month format).i want that format. anybody help me pls

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,416

i already have posted the answer.

check it out.

REPORT ZZSL_SPBUP .

tables: S001.

select-options: SL_SPBUP for S001-SPBUP.

initialization.

SL_SPBUP-LOW = '200401'.

SL_SPBUP-HIGH = '200402'.

append SL_SPBUP.

i already have posted the answer.

check it out.

REPORT ZZSL_SPBUP .

tables: S001.

select-options: SL_SPBUP for S001-SPBUP.

initialization.

SL_SPBUP-LOW = '200401'.

SL_SPBUP-HIGH = '200402'.

append SL_SPBUP.

9 REPLIES 9
Read only

Former Member
0 Likes
1,417

i already have posted the answer.

check it out.

REPORT ZZSL_SPBUP .

tables: S001.

select-options: SL_SPBUP for S001-SPBUP.

initialization.

SL_SPBUP-LOW = '200401'.

SL_SPBUP-HIGH = '200402'.

append SL_SPBUP.

Read only

Former Member
0 Likes
1,416

Not sure if you under stood my previous post on the same subject. Its NOT DD (Days not taken into consideration for period), it should MMYYYY.

In your selection screen if you refer to the same data element S001-SPBUP, you should get your functionality. You can also look at SPMON data element.

What is the issue you are facing?

Regards,

Ravi

Read only

0 Likes
1,416

hi

i want pop up window for month

y u not see MC(A trasn.code

refer after u tell

Read only

0 Likes
1,416

Take a look at the program RMCB0300 (Transaction MC.A). F4 has been implemented for the selection screen for the period year format there

You will have to write your own Process on Value Request, you can take the sample code from that program.

Please ask your question clearly so that the answers are also precise.

Regards,

Ravi

Read only

0 Likes
1,416

in that t.code u see pop up window for year and month. thats only i want

Read only

0 Likes
1,416

That is what I told in the previous post, you will have to implement the same by writing the code in PROCESS ON VALUE REQUEST for the selection screen value. Please take a look at the code in the program and you can have that functionality in your program.

Regards,

Ravi

Note : Please mark all the helpful answers

Read only

Former Member
0 Likes
1,416

Hi Muthu,

Please check this,

parameters : s_date(7).

data : st_date type sy-datum.

<b>INITIALIZATION.</b>

CONCATENATE sy-datum4(2) '.' sy-datum0(4) into st_date.

s_date = st_date.

Please mark helpful answers.

Read only

Former Member
0 Likes
1,416

Hi Muthu,

As Ravi Kumar mentioned already, u have to extract the relevant part from that program - RMCB0300.

Please cut n paste the following code, run it nad see the output.

tables : s031.

select-options: sl_spmon for s031-spmon modif id per.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR SL_SPMON-LOW.

PERFORM MONAT_F4.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR SL_SPMON-HIGH.

PERFORM MONAT_F4.

FORM MONAT_F4.

DATA: BEGIN OF MF_DYNPFIELDS OCCURS 1.

INCLUDE STRUCTURE DYNPREAD.

DATA: END OF MF_DYNPFIELDS.

DATA: MF_RETURNCODE LIKE SY-SUBRC,

MF_MONAT LIKE ISELLIST-MONTH,

MF_HLP_REPID LIKE SY-REPID.

FIELD-SYMBOLS: <MF_FELD>.

  • Wert von Dynpro lesen

GET CURSOR FIELD MF_DYNPFIELDS-FIELDNAME.

APPEND MF_DYNPFIELDS.

MF_HLP_REPID = SY-REPID.

DO 2 TIMES.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

DYNAME = MF_HLP_REPID

DYNUMB = SY-DYNNR

TABLES

DYNPFIELDS = MF_DYNPFIELDS

EXCEPTIONS

INVALID_ABAPWORKAREA = 01

INVALID_DYNPROFIELD = 02

INVALID_DYNPRONAME = 03

INVALID_DYNPRONUMMER = 04

INVALID_REQUEST = 05

NO_FIELDDESCRIPTION = 06

UNDEFIND_ERROR = 07.

IF SY-SUBRC = 3.

  • Aktuelles Dynpro ist Wertemengenbild

MF_HLP_REPID = 'SAPLALDB'.

ELSE.

READ TABLE MF_DYNPFIELDS INDEX 1.

  • Unterstriche durch Blanks ersetzen

TRANSLATE MF_DYNPFIELDS-FIELDVALUE USING '_ '.

EXIT.

ENDIF.

ENDDO.

IF SY-SUBRC = 0.

  • Konvertierung ins interne Format

CALL FUNCTION 'CONVERSION_EXIT_PERI_INPUT'

EXPORTING

INPUT = MF_DYNPFIELDS-FIELDVALUE

IMPORTING

OUTPUT = MF_MONAT

EXCEPTIONS

ERROR_MESSAGE = 1.

IF MF_MONAT IS INITIAL.

  • Monat ist initial => Vorschlagswert aus akt. Datum ableiten

MF_MONAT = SY-DATLO(6).

ENDIF.

CALL FUNCTION 'POPUP_TO_SELECT_MONTH'

EXPORTING

ACTUAL_MONTH = MF_MONAT

IMPORTING

SELECTED_MONTH = MF_MONAT

RETURN_CODE = MF_RETURNCODE

EXCEPTIONS

FACTORY_CALENDAR_NOT_FOUND = 01

HOLIDAY_CALENDAR_NOT_FOUND = 02

MONTH_NOT_FOUND = 03.

IF SY-SUBRC = 0 AND MF_RETURNCODE = 0.

ASSIGN (MF_DYNPFIELDS-FIELDNAME) TO <MF_FELD>. " ==>> note 148804

<MF_FELD> = MF_MONAT.

CALL FUNCTION 'CONVERSION_EXIT_PERI_OUTPUT'

EXPORTING

INPUT = MF_MONAT

IMPORTING

OUTPUT = MF_DYNPFIELDS-FIELDVALUE.

COLLECT MF_DYNPFIELDS.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

DYNAME = MF_HLP_REPID

DYNUMB = SY-DYNNR

TABLES

DYNPFIELDS = MF_DYNPFIELDS

EXCEPTIONS

INVALID_ABAPWORKAREA = 01

INVALID_DYNPROFIELD = 02

INVALID_DYNPRONAME = 03

INVALID_DYNPRONUMMER = 04

INVALID_REQUEST = 05

NO_FIELDDESCRIPTION = 06

UNDEFIND_ERROR = 07. "<<== note 148804

ENDIF.

ENDIF.

ENDFORM. "MONAT_F4

Hope this is what u require.

Read only

Former Member
0 Likes
1,416

Hi Muthu,

Try this code this will work out....put the perform accordingly....

PARAMETERS: S_SPBUP LIKE S062-SPBUP.

DATA : V_DAYS TYPE P VALUE 01, " No.of Days

V_DATFM LIKE USR01-DATFM, " Date format

V_DS TYPE C.

***********************************************************************

PERFORM GET_DATE USING V_DAYS CHANGING V_FROMDATE .

*--- Perform to get no.of days of the month

PERFORM GET_NO_OF_DAYS.

*--- Perform to get posting to-date

PERFORM GET_DATE USING V_DAYS CHANGING V_TODATE.

*--- Perform to get posting period date

PERFORM GET_POSTING_PERIOD_DATE.

&----


*& Form GET_POSTING_DATE

&----


  • To get no.of days of the month

----


FORM GET_NO_OF_DAYS.

DATA: LV_DATE TYPE D.

MOVE V_FROMDATE TO LV_DATE.

CALL FUNCTION 'HR_E_NUM_OF_DAYS_OF_MONTH'

EXPORTING

P_FECHA = LV_DATE

IMPORTING

NUMBER_OF_DAYS = V_DAYS.

ENDFORM.

&----


*& Form GET_DATE

&----


  • To get posting from-date

----


FORM GET_DATE USING F_DAYS CHANGING F_DATE.

DATA: LV_DAYS(2) TYPE N.

MOVE F_DAYS TO LV_DAYS.

CONCATENATE S_SPBUP0(4) S_SPBUP4(2) LV_DAYS INTO F_DATE.

ENDFORM.

&----


*& Form GET_POSTING_PERIOD_DATE

&----


  • To get posting period date

----


FORM GET_POSTING_PERIOD_DATE.

CASE V_DATFM.

WHEN '1'.

V_DS = '.'.

ENDCASE.

IF V_DATFM = '1'.

CONCATENATE V_FROMDATE+6(2) V_DS

V_FROMDATE+4(2) V_DS

V_FROMDATE+0(4)

INTO V_PDATE_LOW.

PERFORM DATE_TO_INTERNAL_FORMAT CHANGING V_PDATE_LOW.

CONCATENATE V_TODATE+6(2) V_DS

V_TODATE+4(2) V_DS

V_TODATE+0(4)

INTO V_PDATE_HIGH.

PERFORM DATE_TO_INTERNAL_FORMAT CHANGING V_PDATE_HIGH.

ENDIF.

ENDFORM.

&----


*& Form DATE_TO_INTERNAL_FORMAT

&----


  • To convert the date into internal format

----


FORM DATE_TO_INTERNAL_FORMAT CHANGING F_DATE.

CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'

EXPORTING

DATE_EXTERNAL = F_DATE

  • ACCEPT_INITIAL_DATE =

IMPORTING

DATE_INTERNAL = F_DATE

  • EXCEPTIONS

  • DATE_EXTERNAL_IS_INVALID = 1

  • OTHERS = 2

.

IF SY-SUBRC <> 0.

ENDIF.

ENDFORM.

Please reward points if you find this as a right solution

Regards,

Harini