‎2008 Oct 23 1:21 PM
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
Parameters: S_MATE like mseg-matnr obligatory.
SELECT-OPTIONS: S_AUDAT1 FOR mkpf-budat obligatory.
s_audat = s_audat1.
SELECTION-SCREEN END OF BLOCK b1.
this is my selection screen code.....
in output i want like this
"ITEM REGISTER for <material description> from <lower date> to <Upper date>"
i am getting like this:
ITEM REGISTER for <material description> from <lowerdate>
how can i get my desired result...
while fetching the data i wrote the code like this
ITEM REGISTER for &wa_it_item-maktx& from &wa_it_item-budat&
what changes i should do....pls help me
‎2008 Oct 23 1:34 PM
Hi,
While calling smartform function module from your driver
program, you should pass some parameter to smartform
e.g. s_audat1-low, s_audat1-high, or text which you can use in your smartform to display from date and to date.
prior to this you should make provision in your smartform using import parameter.
Regards,
Vishal
‎2008 Oct 23 1:40 PM
vishal...thanx...
what u said is correct...i am a fresher...could u pls tell me how can i do that in driver program...i mean
how can i split s_audat as s_audat-low and s_audat-high
‎2008 Oct 23 1:49 PM
Hi,
You have to pass select option su_audit as a export parameter while calling smart form .
There in smart form you to define this parameter in Form interface as a assiciated type of table .
Now, use it
ITEM REGISTER for from &su_audit-low& to &su_audit-high&.
Thanks,
Smita
‎2008 Oct 23 2:10 PM
Hi ,
You dont need to split this select option.
its internally saved as a table which contain lower and higher value.
You can directly access that.
Thanks,
Smita
‎2008 Oct 24 9:58 AM
Hi Smita
i thank u that u try to help me...
but i am getting an error like this...
The data object "S_AUDAT" has no structure and therefore no component called "LOW".
why i am getting like this?
what should i do now friend...
BR,
Rajkamal
‎2008 Oct 24 10:33 AM
‎2008 Oct 24 10:42 AM
Hi Rajkamal,
I see that you are using S_AUDIT1 as your select option name and not S_AUDIT. so instead of S_AUDIT try using
S_AUDIT1-LOW. I hope this should solve your issue.
Best Regards,
Ram.
‎2008 Oct 24 10:54 AM
Ram,
it didnt solve the problem...
it says the same error....The data object "S_AUDAT1" has no structure and therefore no component called "HIGH". .
anything else can i try
‎2008 Oct 24 10:49 AM
Hi,
In your function module under export parameters take two fields like s_audat1-low and s_audat1-high.
In source code take statement ranges : r_audit for mkpf-budat.
then make
r_audit-low = s_audat1-low,
r_audit-high = s_audat1-high,
r_audit-sign = 'I'.
r_audit-option ='BT'.
append r_audit.
now select based on r_audit , in this way u can pass select options to function module...
Hope this is helpful..
Rgds.,
subash
‎2008 Oct 24 11:16 AM
Subash,
should i create a structure for r_audat....
i am getting error like r_audat is not having a structure so there is no component like low...
pls clarify it to me
Edited by: Rajkamal Ayamperumal on Oct 24, 2008 12:17 PM
‎2008 Oct 24 11:20 AM
hi,
No man befor r_audit i am declaring it as ranges.
Ranges is similar like a selopt structure... so no need to decalre seperate structure for that.
If u still do not understand then declare in the same way, check in debugging what that
r_audit holds u can see four fields low high sign option..
Rgds.,
subash
‎2008 Oct 24 3:47 PM
friends,
i tried what suggested...still i am getting errors...can u pls give me the codings...
I'll give u my program...
REPORT ITEM_REGISTER.
*******************************************************************
*Tables Decleration
*******************************************************************
TABLES : makt,lfa1, mseg, mkpf, rbkp.
DATA : FNAME TYPE RS38L_FNAM.
*data: r_audat like mkpf-budat.
DATA : s_audat LIKE mkpf-budat.
DATA: DATE1 LIKE mkpf-budat.
DATA: DATE2 LIKE mkpf-budat.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
Parameters: S_MATE like mseg-matnr obligatory.
SELECT-OPTIONS: S_AUDAT1 FOR mkpf-budat obligatory.
s_audat = s_audat1.
*ranges : r_audat for mkpf-budat.
*r_audat-low = s_audat1-low.
*r_audat-high = s_audat1-high.
*r_audat-sign = 'I'.
*r_audat-option ='BT'.
*append r_audat.
SELECTION-SCREEN END OF BLOCK b1.
data : itab LIKE zitab OCCURS 0 WITH HEADER LINE.
Data : it_item like zitem1 OCCURS 0 WITH HEADER LINE.
data : it_makt LIKe makt occurs 0 WITH HEADER LINE.
data : it_mseg like mseg occurs 0 WITH HEADER LINE.
data : it_mkpf like mkpf occurs 0 WITH HEADER LINE,
it_lfa1 like lfa1 OCCURS 0 WITH HEADER LINE.
Perform intialization.
perform fill_it_item.
perform call_form.
&----
*& Form INTIALIZATION
&----
FORM INTIALIZATION .
clear it_item.
clear it_makt.
clear it_mseg.
clear it_mkpf.
clear it_lfa1.
clear it_item[].
clear it_makt[].
clear it_mseg[].
clear it_mkpf[].
clear it_lfa1[].
ENDFORM. " INTIALIZATION
&----
*& Form FILL_IT_ITEM
&----
FORM FILL_IT_ITEM .
select * from mseg
into table it_mseg
where matnr = s_mate.
LOOP at it_mseg.
select * from mkpf into TABLE it_mkpf
where budat in s_audat1
where budat in r_audat
and mblnr = it_mseg-mblnr.
LOOP AT IT_MKPF.
IF DATE1 = '00000000'.
At FIRST.
DATE1 = iT_MKPF-budat.
ENDAT.
ENDIF.
AT LAST.
DATE2 = IT_MKPF-budat.
ENDAT.
ENDLOOP.
LOOP at it_mkpf.
itab-budat = it_mkpf-budat.
itab-mblnr = it_mkpf-mblnr.
append itab.
ENDLOOP.
Endloop.
loop at itab.
select * from mseg into table it_mseg where mblnr = itab-mblnr and matnr = s_mate.
Loop at it_mseg.
it_item-matnr = it_mseg-matnr.
it_item-dmbtr = it_mseg-dmbtr.
it_item-mblnr = it_mseg-mblnr.
it_item-bwart = it_mseg-bwart.
it_item-budat = itab-budat.
it_item-erfmg = it_mseg-erfmg.
it_item-lifnr = it_mseg-lifnr.
it_item-rate = it_item-dmbtr / it_item-erfmg.
append it_item.
*DELETE ADJACENT DUPLICATES FROM It_item COMPARING ALL FIELDS.
SORT It_item BY budat ASCENDING.
DELETE ADJACENT DUPLICATES FROM It_item COMPARING ALL FIELDS.
Endloop.
Endloop.
loop at it_item.
Select single maktx
from makt
into it_item-maktx
where matnr = it_item-matnr.
modify it_item.
Endloop.
loop at it_item.
Select single name1
from lfa1
into it_item-name1
where lifnr = it_item-lifnr.
modify it_item.
DELETE ADJACENT DUPLICATES FROM It_item COMPARING ALL FIELDS.
Endloop.
LOOP AT IT_ITEM.
*delete it_item where bwart <> '101''501''122''161''201''261'.
delete it_item where bwart <> '501'.
delete it_item where bwart <> '122'.
delete it_item where bwart <> '161'.
delete it_item where bwart <> '201'.
delete it_item where bwart <> '261'.
"'501''122''161''201''261'.
DELETE it_item WHERE bwart NE '101'
AND bwart NE '501'
AND bwart NE '122'
AND bwart NE '161'
AND bwart NE '201'
AND bwart NE '261'.
MODIFY it_item.
*DELETE ADJACENT DUPLICATES FROM It_item COMPARING ALL FIELDS.
ENDLOOP.
ENDFORM. " FILL_IT_ITEM
*Loop at it_item.
*
if it_item-bwart = '101' or '501'.
it_item-new1 = '001'.
else.
it_item-new1 = '002'.
ENDIF.
*modify it_item.
*SORT It_item BY new1 ASCENDING.
*ENDLOOP.
&----
*& Form CALL_FORM
&----
FORM CALL_FORM .
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZITEM_REGISTER' "sfname
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FNAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION '/1BCDWB/SF00000022'
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
DATE1 = DATE1
DATE2 = DATE2
*R_AUDAT = R_AUDAT
*S_AUDAT1-LOW = S_AUDAT1-LOW
*S_AUDAT1-HIGH = S_AUDAT1-HIGH
S_AUDAT = S_AUDAT
S_MATE = S_MATE
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
IT_ITEM = IT_ITEM
ITAB = ITAB
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
clear it_item.
clear it_item[].
ENDFORM. " CALL_FORM
subash...pls have a look at it...