Problem in printing the selected labels value in smartform-SD_PACKING.....
Dear all,
Iam trying to print the packing list using smarforms,
T.Code - VL74 - After providing the input for the selection screen,
eg. output_type - 0001.
outbound.deliv - 80000834.
In the "OUTPUT FROM HANDLING UNITS" screen, im getting the list of labels available for that selection.
say for eg.
HU Ob Object key Out. Med Role Name 1 City PkMtT PackMatls
1000004002 01 0080000834 0001 1 WE CALCADOS LTDA BENTO GONCALVES Z001 300026
1000004003 01 0080000834 0001 1 WE CALCADOS LTDA BENTO GONCALVES Z001 300026
1000004005 01 0080000834 0001 1 WE CALCADOS LTDA BENTO GONCALVES Z001 300026
1000004006 01 0080000834 0001 1 WE CALCADOS LTDA BENTO GONCALVES Z001 300026
with the Selection check box attached to the first field, when i
select the first and second HUs, it should be passed to the
driver program, but im getting only one HU value passed into the driver program.
In the driver program my code goes like below,
REPORT ZSDPACKDR LINE-COUNT 100 MESSAGE-ID VV.
TABLES: VBCO3, TVST.
INCLUDE ZPALIDATA_PL.
INCLUDE RVADTABL.
DATA: RETCODE LIKE SY-SUBRC, "Returncode
XSCREEN(1) TYPE C. "Ausgabe Printer/Screen
Internal table for lips
DATA: lips_wa TYPE lips.
DATA: int_lips LIKE lips_wa OCCURS 0 WITH HEADER LINE.
*& Form ENTRY
text
-->RETURN_CODE text
-->US_SCREEN text
FORM ENTRY USING RETURN_CODE US_SCREEN.
CLEAR RETCODE.
XSCREEN = US_SCREEN.
PERFORM PROCESSING USING XSCREEN.
IF RETCODE NE 0.
RETURN_CODE = 1.
ELSE.
RETURN_CODE = 0.
ENDIF.
ENDFORM. "ENTRY
FORM PROCESSING USING PROC_SCREEN.
PERFORM GET_DATA.
CHECK RETCODE = 0.
ENDFORM. "PROCESSING
FORM GET_DATA.
REFRESH: LVBPLK, LVBPLA, int_lips.
CLEAR: LVBPLK, LVBPLA, int_lips.
DATA: FM_NAME TYPE RS38L_FNAM.
VBCO3-VENUM = NAST-OBJKY. "00000.....
VBCO3-SPRAS = NAST-SPRAS. "D
VBCO3-KUNDE = NAST-PARNR. "KUNDE
VBCO3-PARVW = NAST-PARVW. "WE
VBCO3-PACKD = 'X'.
CALL FUNCTION 'SD_PACKING_PRINT_VIEW_SINGLE'
EXPORTING
COMWA = VBCO3
IMPORTING
VBPLK_WA = LVBPLK
VBPLA_WA = LVBPLA
VBADR_TVST = LVBADR "n_916660
TABLES
VBPLP_TAB = LVBPLP
EXCEPTIONS
SHIPPING_UNIT_NOT_UNIQUE = 1
SHIPPING_UNIT_NOT_FOUND = 2
OTHERS = 3.
IF SY-SUBRC NE 0.
RETCODE = 1.
PERFORM PROTOCOL_UPDATE.
ENDIF.
in the above coding, i used SD_PACKING_PRINT_VIEW_SINGLE', but i tried with SD_PACKING_PRINT_VIEW also, but no values getting loaded in the importing structures. if im doing anything wrong, pls correct me.
*CALL FUNCTION 'SD_PACKING_PRINT_VIEW'
EXPORTING
COMWA = VBCO3
AUFTRAG_NICHT_LESEN = ' '
EXPORTDATEN_NICHT_LESEN = ' '
IMPORTING
VBPLA_WA =
TABLES
VBPLK_TAB = LVBPLK
VBPLP_TAB = LVBPLP
VBPLS_TAB = LVBPLS
EXCEPTIONS
OBJECT_NOT_FOUND = 1
OTHERS = 2
*IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
The problem is:
For any of the above function call,
The VBCO3 itself im getting only one label number, hence it is processing for only one, i want to know how to pass on the multiple
label number to this function call ie, in VBC03.
meaning i would like to know, in which internal table , i can get the list of all the selected HUs, so that i shall loop this function call inorder get the appropriate output.
kindly help me to sort this issues.
Points assured.
regs,
Raja
Dear Srihari,
I wrote above code in first label(now i deleted do-enddo) only.
first i am moving seven lebels data into seven wa's.
after that reading the first record and moving another itab(for printing at main window i.e. 8 label).
clearly, there is no space problem..because instead puttting all the required field i put only customer name.
Now it is printing well in first page with 8 labels(main window) also.
But in the second Page it displays only 7 labels and not printing rest of the labels.
for example my itab has 20 records it displays 8 labels in first page &
next 7 labels in second page and not print the rest of the 5 labels i.e. it is not calling third page(?).
code..
CLEAR : WA1, WA2, WA3, WA4, WA5, WA6, WA7.
loop at it_final into wa_final FROM 1 TO 7.
if sy-tabix = '1'.
wa1 = wa_final.
elseif sy-tabix = '2'.
wa2 = wa_final.
elseif sy-tabix = '3'.
wa3 = wa_final.
elseif sy-tabix = '4'.
wa4 = wa_final.
elseif sy-tabix = '5'.
wa5 = wa_final.
elseif sy-tabix = '6'.
wa6 = wa_final.
elseif sy-tabix = '7'.
wa7 = wa_final.
endif.
endloop.
delete it_final from 1 to 7.
**Push every 8th row if it_final in it_main
read table it_final into wa_final index 1. "deleting 8th, 16th,... records
if sy-subrc = 0.
append wa_final to it_main.
else.
exit.
endif.
*Delete the rows from it_main which are present in it_final
loop at it_main into wa_final.
delete table it_final from wa_final. "deleting 8 th row from it_final.
endloop.
Edited by: anurag.radha on Jan 6, 2012 1:09 PM
Similar Messages
-
Problem in Passing the select-options data in smartforms
Dear ABAPers,
I have developed new layout for Delivery Chellan using smartforms.
using parameters i am getting document no, corresponding all details getting print.
but the client wants to use multiple document no.
in function module also i am passing only one import parameter (i.e. doc.no).
my requirement is how to pass multiple data in smartfroms.
Thanks & Regards,
AshokDear ABAPers,
Here i give my code Please check it out and tell me where i am going wrong.
*& Report ZMM_DC_FORM *
REPORT ZMM_DC_FORM .
Data Declaration
tables : mseg,
mkpf,
ekpo,
ekko,
objk,
mbew,
ser03,
twlad,
makt,
adrc.
data : begin of struct_mblnr,
mblnr type mblnr,
end of struct_mblnr.
data : it_mblnr like table of struct_mblnr with header line.
data : begin of i_struct,
mblnr like mseg-mblnr,
mjahr like mseg-mjahr,
matnr like mseg-matnr,
erfmg like mseg-erfmg,
werks like mseg-werks,
lgort like mseg-lgort,
ebeln like mseg-ebeln,
ebelp like mseg-ebelp,
umwrk like mseg-umwrk,
end of i_struct.
data : begin of bednr_struct,
matnr type ekpo-matnr,
bednr type ekpo-bednr,
end of bednr_struct.
data : begin of price_struct,
matnr type mseg-matnr,
verpr type mbew-verpr,
stprs type mbew-stprs,
end of price_struct.
data : begin of serial_struct,
matnr like objk-matnr,
sernr like objk-sernr,
end of serial_struct.
data : begin of fi_struct,
matnr type mseg-matnr,
maktx type makt-maktx,
bednr type ekpo-bednr,
erfmg type mseg-erfmg,
verpr type mbew-verpr,
val_p type mbew-verpr,
end of fi_struct.
data : it_tab like table of i_struct with header line.
data : it_add1 type table of adrc with header line,
it_add2 type table of adrc with header line.
data : it_bednr like table of bednr_struct with header line.
data : it_price like table of price_struct with header line.
data : it_ser type table of ZMM_DC_SERIAL with header line.
data : it_final like table of fi_struct with header line.
data : s_date like mkpf-budat.
data : s_ebeln like ekpo-ebeln.
DATA : FM_NAME TYPE RS38L_FNAM.
Selection Screen Variables
selection-screen : begin of block b1 with frame title text-001.
select-options : s_mblnr for mseg-mblnr.
parameters : s_mjahr type mseg-mjahr.
selection-screen : end of block b1.
Start of Selection
start-of-selection.
select mblnr from mseg into table it_mblnr where mblnr ge s_mblnr-low
and mblnr le s_mblnr-high.
delete adjacent Duplicates from it_mblnr.
*loop at it_mblnr.
*write : it_mblnr-mblnr.
*endloop.
loop at it_mblnr.
select mblnr
mjahr
matnr
erfmg
werks
lgort
ebeln
ebelp
umwrk from mseg into table it_tab where mblnr = it_mblnr-mblnr
and mjahr = s_mjahr
and xauto <> 'X'.
read table it_tab index 1.
*code for PO Number
s_ebeln = it_tab-ebeln.
*code for Supplying plant address
select single adrnr from twlad into twlad-adrnr where werks = it_tab-werks
and lgort = it_tab-lgort.
select single * from adrc into it_add1 where addrnumber = twlad-adrnr.
clear twlad-adrnr.
*code for receiving plant address
select single lgort from ekpo into ekpo-lgort where ebeln = it_tab-ebeln
and ebelp = it_tab-ebelp.
select single adrnr from twlad into twlad-adrnr where werks = it_tab-umwrk
and lgort = ekpo-lgort.
select single * from adrc into it_add2 where addrnumber = twlad-adrnr.
clear : twlad-adrnr,
ekpo-lgort.
*code for the Material Document Date
select single budat from mkpf into s_date where mblnr = it_mblnr-mblnr
and mjahr = s_mjahr.
loop at it_tab.
it_final-matnr = it_tab-matnr.
it_final-erfmg = it_tab-erfmg.
*Code for Material Description
select single maktx from makt into makt-maktx where matnr = it_tab-matnr.
it_final-maktx = makt-maktx.
clear makt-maktx.
*Code for Service order Number
select single matnr
bednr from ekpo into it_bednr where ebeln = it_tab-ebeln
and ebelp = it_tab-ebelp
and matnr = it_tab-matnr.
it_final-bednr = it_bednr-bednr.
*Code for Price for the Material
select single matnr
verpr
stprs from mbew into it_price where matnr = it_tab-matnr
and bwkey = it_tab-werks.
if it_price-verpr <> 0.
it_final-verpr = it_price-verpr.
else.
it_final-verpr = it_price-stprs.
endif.
it_final-val_p = it_final-erfmg * it_price-stprs.
append it_final.
clear it_final.
endloop.
*Code for Serial Number
select single obknr from ser03 into ser03-obknr where mblnr = it_mblnr-mblnr
and vorgang = 'MMSL'.
select matnr
sernr from objk into table it_ser where obknr = ser03-obknr.
clear ser03-obknr.
*Calling Function Module for Smartform
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZMM_DC_FORM'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
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 FM_NAME
EXPORTING
L_MBLNR = it_mblnr-mblnr
L_DATE = S_DATE
L_EBELN = S_EBELN
IT_ADD1 = IT_ADD1
IT_ADD2 = IT_ADD2
TABLES
IT_FINAL = IT_FINAL
IT_SER = IT_SER.
endloop.
Please help me to solve this problem.It is very urgent.
Thanks & Regards,
Ashok. -
Problem in enabling the selection screen
Hi ,
I have problem in enabling the selection screen.
i have radio button and based on the radio button i need to make the date field as mandatory.
When i tried this with at selection screen on radio button group XXX, itu2019s not triggering.
Could you please help me by resolving the above problem?
VijayHi,
see the sap documentation
... RADIOBUTTON GROUP group [USER-COMMAND fcode]
Effect:
This addition specifies that the input field is displayed as a radio button in the first position on the selection screen, and the output field is displayed next to it on the right. The radio button is selected if the value of para is "X" or "x". Otherwise, it is not selected.
group is used to define the radio button group for the parameter. The name group is entered directly as a character string with a maximum of 4 characters. Within a selection screen, there must be a minimum of two parameters in the same radio button group. There cannot be more than one radio button group with the same name in one program, even if they are defined in different selection screens.
The parameter must be specified with the type c and length 1. Explicit length specification using len is not permitted. If the addition TYPE is used, it can only be followed by the generic type c or a non-generic data type of type
In a radio button group, only one parameter can be defined with the addition DEFAULT, and the specified value must be "X". By default, the first parameter in a radio button group is set to the value "X", and the rest are set to " ".
The addition USER-COMMAND can be used to assign a function code fcode to the first parameter in a radio button group. The function code fcode must be specified directly, and have a maximum length of 20 characters. To evaluate the function code, an interface work area of the structure SSCRFIELDS from the ABAP Dictionary must be declared using the statement TABLES. When the user selects any radio button of the radio button group on the selection screen, the runtime environment triggers the event AT SELECTION-SCREEN and transfers the function code fcode to the component ucomm of the interface work area sscrfields. If a function code used in the GUI status of the selection screen is specified for fcode, the selection screen processing is affected accordingly.
Note:
It is recommended to define the radio buttons of a radio button group directly underneath each other. If the selection screen also contains other elements, it is recommended to define each radio button group within a block surrounded by a frame.
Regards,
Venkatesh -
While Printing The Ontest labels in the thermal printer it is printing Rev
While Printing The Ontest labels in the thermal printer it is printing Rev
the problem is my if my heading is on top
and footer is at the end in preprinted
my print has to be rotated 180 degreesResolved Myself.
-
I have a Problem in print the long description data through EDI.
I have a Problem in print the long description data through EDI:Actually we want to print the long description data through EDI, but it not handling our huge long description data. Here is the example of that>We can print the first two lines into EDI output, but it is failing to print the below text:
<B>EPSON, TM-U590 Series: </B> Reliable 88 column slip printer. Operator friendly dot matrix impact printing. Ideal for hotel, bank, restaurant and many more applications .<br><BR> Includes: Printer, Black ribbon & a Connect-It Interface. Power Supply & interface cable sold separately. All printers are RoHS compliant & have a standard 1 year depot warranty. <BR> <BR>
-------------------------------------Failing to print this lines------------------------------------------------------------------
<b>COLORS:</b> Epson Cool White (ECW) Only<BR><BR><B><FONT COLOR=#FF0000#>Click links below for helpful Information</FONT><b><br><table border="0" bordercolor="" style="" width="100%" cellpadding="5" cellspacing="5"><tr><td><FONT SIZE="2"><CENTER><A HREF="www.sample.com"f.2605" target="_blank"><b>Spec Sheet</b></a></CENTER></FONT></td><td><FONT SIZE="2"><CENTER><A HREF="www.sample.com"f.2606" target="_blank"><b>MSRP Price List</b></a></CENTER></FONT></td><TD><FONT SIZE="2"><CENTER><A HREF="www.sample.com"f.2868" target="_blank"><b>Product Information Guide</b></a></CENTER></FONT></TD></TR><TR><td><FONT SIZE="2" COLOR=#0000FF><B>Warranty Information</B></FONT></td></tr><Tr><td><FONT SIZE="2"><CENTER><A HREF="www.sample.com"f.2554" target="_blank"><b>Depot Warranty</b></a></CENTER></FONT></td><td><FONT SIZE="2"><CENTER><A HREF="www.sample.com"f.2555" target="_blank"><b>Spare In the Air Warranty</b></a></CENTER></FONT></td><td></td></tr></table><br>
Please provide some useful thoughts on this EDI issue.
Thanks
AmeerTry using the FM:
ENQUE_READ2
Passing the follwing values:
GNAME --> VBAK (Sales Order header table)
GARG --> The lock argument
(This will be a combination of client number anb Sales Order No.
Eg: '3001210000054' where the first three digit i,e 300 is the client No
and 1210000054 is the sales order no.)
Regards,
Firoz. -
How to Print the same field value in a single row
Hi,
I need to print the same field values in a single row
For Examble
in a table TestTable
ID Name Value
1 AB 120
1 BC 150
1 CD 130
2 AB 111
2 BC 112
2 CD 113
I need the query like if the Name contains BC and CD then i need to print like ID, BC Value, CD Value as below
ID BC'Value CD'Value
1 150 130
2 112 113
Kindly suggest me...
Thanks in Advance
AnuHi,
Since you're on 9i some available functionality unfortunatly isn't at your disposal.
This should work, however, using your sample data:
MHO%xe> create table t as ( -- generating sample data:
2 select 1 cid, 'AB' cname, 120 cvalue from dual union all
3 select 1, 'BC', 150 from dual union all
4 select 1, 'CD', 130 from dual union all
5 select 2, 'AB', 111 from dual union all
6 select 2, 'BC', 112 from dual union all
7 select 2, 'CD', 113 from dual
8 );
Tabel is aangemaakt.
MHO%xe> select cid
2 , max(decode(cname, 'BC', cvalue, null)) BC_value
3 , max(decode(cname, 'CD', cvalue, null)) CD_value
4 from t
5 group by cid;
CID BC_VALUE CD_VALUE
1 150 130
2 112 113For reference and future challenges, see:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:419593546543
http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php -
How can we pass the select-option value to modulepool program?
hi,
how can we pass the select-option value to modulepool program ?
Because if i declared select-options in executable program and i used SSCRFIELDS to define push buttons in selection screen.
My requirement if enter the values to select-options and press UPDATE pussbotton then i want call screen which contains tablecontrol.
How i get select-option values to PAI of call screen for getting the data from database table to my internal table?Oh I thought that you have selection-screen and again you are working on dialog programming.
if you want to use select-option directly in module pool then it is not possible.
but you can do other way.
create two varaiables
data : v_kun_low like kna1-kunnr,
v_kun_high like kna1-kunnr.
use these two variables in layout ,let user knows that he can not give options like gt,lt,eq ,it will be always BT.
and also when you see normal report program,you can use multiple values in either low or high,but here it is not possibel.
use can enter only low value and high value.
when you come to program point of view
declare one range
ranges r_kunnr for kna1-kunnr.
do the coding like
r_kunnr-low = v_kun_low.
r_kunnr-high = v_kun_high.
r_kunnr-options = 'BT'.
r_kunnr-sign = 'I'.
append r_kunnr.
now you can use r_kunnr in select query ,it will work like select-option.
other than this there is no option.
Thanks
Seshu -
How to get the selected node value of a tree which is build on java code
Hi Experts,
How can i get the selected node value if I build the tree programatically.
I am using the following code in selectionListener but it is throwing error.
RichTreeTable treeTable = (RichTreeTable)getQaReasontreeTable();
CollectionModel _tableModel =
(CollectionModel)treeTable.getValue();
RowKeySet _selectedRowData = treeTable.getSelectedRowKeys();
Iterator rksIterator = _selectedRowData.iterator();
String selectedQaCode ="";
while (rksIterator.hasNext()) {
List key = (List)rksIterator.next();
JUCtrlHierBinding treeTableBinding =
(JUCtrlHierBinding)((CollectionModel)treeTable.getValue()).getWrappedData();
JUCtrlHierNodeBinding nodeBinding =
treeTableBinding.findNodeByKeyPath(key);
String nodeStuctureDefname =
nodeBinding.getHierTypeBinding().getStructureDefName();
selectedQaCode = selectedQaCode + nodeBinding.getAttribute(0);
where I am using following link to create a tree with java code.
http://one-size-doesnt-fit-all.blogspot.com/2007/05/back-to-programming-programmatic-adf.html
Please help me in resolving this issue.
Regards
GayazHi,
you should also move
JUCtrlHierBinding treeTableBinding =
(JUCtrlHierBinding)((CollectionModel)treeTable.getValue()).getWrappedData();
out of the while loop as this is not necessary to be repeated for each key in the set
Frank -
Problem in Printing the ALV list
Hi,
I have one problem with printing the ALV list. While printing the ALV list(thro Print Icon on application Tool bar) ,Fist page of my print out contains some other inforamtion.
inforamtions included two tables
first table contains Sort Criteria, Ascdg, Descnd, Subtotal columns.
And second table contains Data statistics , number of
columns.
But from Second page onwards , my alv list printed correctly .
How can i avoid the First page inforamtion and
what is the Reason of coming like this?
Thanks,
Neptune.MI assume you are using function module Reuse_alv_grid_display or reuse_alv_list_display for ALV.
If this is the case, there is a parameter called IS_PRINT that you need to supply while calling the function module.
you can for exapmle declare
data:
printstruc type SLIS_PRINT_ALV.
printstruc-NO_PRINT_LISTINFOS = 'X'.
call function 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IS_PRINT = printstruc
There are many other flags in is_print structures that you can use to manipulate the printing.
Cheers! -
Problem with Printing the Billing date...
Hi Experts...
Here im facing the problem in printing the billing date.
The scenario is as follows.
The posting date of Billing is 10.10.2008
The document date of Billing is also 10.10.2008.
At the time of printing the Billing document it is taking another date otherthan 10.10.2008,where it should be 10.10.2008.
What modifications should i do to rectify the problem.
Please advice.
Regards,
Y P.Prasad,
Ask your ABAPer do debug and find out what date (Table-Field) is used in the Invoice Output program. You will know the reason and if you think that the date being used is incorrect, you can ask your ABAPer to change it to VBRK-FKDAT which is the billing date.
Chandan -
How to get the selection parameter values to Posting logic method
How can i read the selection parameter values at " posting logic" method, which are given in " Select Option function module"?
max bianchi wrote:
Hi
>
> The selection-screen data are stored in ABAP memory, so it need to clear it .
>
> Now how set ID parameter can depend on SAP release, anyway in ECC 6 this should work:
>
>
INITIALIZATION.
> DATA: BEGIN OF MEMKEY,
> REPORT TYPE SY-REPID VALUE SY-REPID,
> VARIANT TYPE RSVAR-VARIANT,
> INT_MODE(2) TYPE N,
> KIND(1) TYPE C,
> END OF MEMKEY.
>
> SYSTEM-CALL INTERNAL MODE INTO MEMKEY-INT_MODE.
> FREE MEMORY ID MEMKEY.
>
> But in this way it'll clea whole selection-screen...do you wnat do it?
>
> Max
@Max : The above hack seem to work fine unless you assign a 'DEFAULT' value to the selection fields.
@OP : Here is an other work around, however, this approach needs an additional effort to create
new PF-STATUS('MYLIST') and assign a function code of your choice to the function keys in the standard toolbar and handle them in the 'AT USER-COMMAND' event as shown below. Let us know if you have/find any issues with this.
PARAMETERS:
p_test TYPE char5 DEFAULT '123'.
AT USER-COMMAND.
CASE syst-ucomm.
WHEN 'MBACK'.
SUBMIT zytest WITH p_test = '' VIA SELECTION-SCREEN.
ENDCASE.
START-OF-SELECTION.
SET PF-STATUS 'MYLIST'.
-Rajesh. -
How do i print the shipping label for repair?
I'm on the Apple Support Repair status section and i cannot see where to print the shipping label to send via post? Any ideas? They said on phone there would be a link but I cannot see one?
Yes, I'd start by contacting Verizon Customer Service, first.
If you fail to contact them before your phone is shipped out, call FedEx Customer Service, explain the situation, provide the tracking number, and have the address changed. I know FedEx does it, as I've had to do it with signed orders in the past. -
I don't want to print the last page of a smartform when there is no content
I don't want to print the last page of a smartform when there is no content. Kindly help
If the last page is printed, there are two possibilities
-1- The MAIN WINDOW is only in this page
-2- The page is explicitly printed from another page (new-page)
-3- There is date but its only space or skip line.
So in your form
-1- Redefine the logic of your form
-2- Check that, there are some data to be printed before calling the NEW-PAGE
-3- Do skip or write space lines before printing an actual line and not after
Regards -
Script- problem in printing the values in from internal table
Hi all,
I have a requiremnt that i for a particular document no there are number of invoices are there. i.e for a single document no there are 20 invoices in that. i shoudl display the invoice number , invoice date, invoice amount , number of days of intrest , start date of interest, end date of interest and intrest amount.
The problem is i should take the invoice number, invoice date, number of days from TABLE <b>BSEG</b> and inovice amount and start date, end date from table<b> INTITIT</b>. for a particular document number there are diffent invoce numbers in both the table.
i can display everthing but the prob is with invoice amount. it is repating only one values is displying in the ouput. The invoice number in INTITIT Is not changing. I have to write the syntax for that .Please help me The value in Bseg is chaing as per given syntax shown below.
data: begin of hbseg occurs 10.
include structure hsortp.
include structure bseg.
data: end of hbseg.
data: begin of hsortp,
sortp1 like sortp1,
sortp2 like sortp2,
sortp3 like sortp3,
sortp4 like sortp4,
sortp5 like sortp5,
EKVBD LIKE KNB1-EKVBD,
end of hsortp.
loop at hbseg.
WHERE BUKRS = SAVE_BUKRS.
save_bukrs = hbseg-bukrs.
if ( hbseg-kunnr = save_kunnr
and not save_kunnr is initial )
or ( hbseg-lifnr = save_lifnr
and not save_lifnr is initial ).
clear bseg.
move-corresponding hbseg to bseg.
*bseg = bseg.
if bkpf-waers ne *bkpf-waers.
perform curr_document_convert_bseg
using
bkpf-budat
*bkpf-waers
*bkpf-hwaer
bkpf-waers
changing
bseg.
if not bseg-pycur is initial.
alw_waers = bseg-pycur.
perform currency_get_subsequent
using
save_repid
bkpf-budat
bkpf-bukrs
changing
alw_waers.
if alw_waers ne bseg-pycur.
bseg-pycur = alw_waers.
perform convert_foreign_to_foreign_cur
using
bkpf-budat
*bkpf-waers
*bkpf-hwaer
bseg-pycur
changing
bseg-pyamt.
endif.
endif.
endif.
perform fill_waehrungsfelder_bseg.
perform fill_waehrungsfelder_bseg_2.
if bseg-sgtxt(1) ne '*'.
bseg-sgtxt = space.
else.
bseg-sgtxt = bseg-sgtxt+1.
endif.
clear save_bschl.
clear save_umskz.
clear tbslt.
save_bschl = bseg-bschl.
save_umskz = bseg-umskz.
perform read_tbslt.
ADDING VARIBLE V_GSALDF BY SUNIL 5.11.07******
v_gsaldf = rf140-gsaldf + rf140-wrshb.
rf140-gsaldf = v_gsaldf.
clear v_gsaldf.
SUNIL *********************
*rf140-gsaldf = *rf140-gsaldf + *rf140-wrshb.
if xmultk is initial
and xactiv is initial
and linecnt = '1'
and not xumsst is initial
and not save_xumstn is initial.
if bkpf-bstat = 'V'.
perform read_vbset.
else.
perform read_bset.
endif.
describe table hbset lines linecnt.
if linecnt = '1'.
loop at hbset.
move-corresponding hbset to bset.
*bset = bset.
if bkpf-waers ne *bkpf-waers.
perform curr_document_convert_bset
using
bkpf-budat
*bkpf-waers
*bkpf-hwaer
bkpf-waers
changing
bset.
endif.
clear rf140-msatz.
clear rf140-vtext.
save_ktosl = bset-ktosl.
perform read_t687t.
rf140-msatz = bset-kbetr / 10.
*rf140-msatz = rf140-msatz.
rf140-vtext = save_vtext.
*rf140-vtext = rf140-vtext.
if bset-shkzg = 'H'.
rf140-mwshb = bset-fwste.
*rf140-mwshb = *bset-fwste.
rf140-mdshb = bset-hwste.
*rf140-mdshb = *bset-hwste.
else.
rf140-mwshb = 0 - bset-fwste.
*rf140-mwshb = 0 - *bset-fwste.
rf140-mdshb = 0 - bset-hwste.
*rf140-mdshb = 0 - *bset-hwste.
endif.
exit.
endloop.
rf140-wrshb = rf140-wrshb - rf140-mwshb.
*rf140-wrshb = *rf140-wrshb - *rf140-mwshb.
rf140-dmshb = rf140-dmshb - rf140-mdshb.
*rf140-dmshb = *rf140-dmshb - *rf140-mdshb.
endif.
endif.
*****************Begin of Change by Karthikeyan J********************
i_count = i_count + 1.
clear rf140-element.
clear: it_bseg, i_wrbtr,i_totday,i_tempday,i_day,i_bday.
comparing with fields belnr AND SELECT * FROM INTITIT added by sunil 3.11.07*********
select single * from bseg into
corresponding fields of it_bseg where belnr = bseg-rebzg anD GJAHR = BSEG-GJAHR.
select single * from intitit into corresponding fields of it_intitit where gjahr = bseg-gjahr and belnr_to = bseg-belnr and buzei = '2' OR BELNR = INTITIT-BELNR .
added by Jayshree on 09/01/2007
MOVE ' ' TO it_kna1-name1.
SELECT SINGLE name1
INTO CORRESPONDING FIELDS OF it_kna1
FROM ( vbpa AS a INNER JOIN kna1 AS b ON akunnr = bkunnr )
WHERE a~vbeln = it_bseg-vbeln
AND a~parvw = 'zd'.
SELECT SINGLE fkdat
INTO CORRESPONDING FIELDS OF it_kna1
FROM vbrk
WHERE vbrk~vbeln = it_bseg-vbeln.
added by Jayshree on 01/02/2007
CONCATENATE it_kna1-fkdat6(2) it_kna1-fkdat4(2) it_kna1-fkdat+2(2)
INTO vfkdat SEPARATED BY '.'.
CONCATENATE it_bseg-augdt6(2) it_bseg-augdt4(2) it_bseg-augdt+2(2)
INTO vaugdt SEPARATED BY '.'.
i_wrbtr = i_wrbtr + it_bseg-wrbtr.
added as on 29.06.2007 by jayshree again transport on 21.07.2007
tot_wrbtr = tot_wrbtr + i_wrbtr.
i_totday = it_bseg-zbd1t + it_bseg-zbd2t + it_bseg-zbd3t.
CALL FUNCTION 'fima_date_create'
EXPORTING
i_date = it_bseg-zfbdt
I_FLG_END_OF_MONTH = ' '
I_YEARS = 0
I_MONTHS = 0
i_days = i_totday
I_CALENDAR_DAYS = 0
I_SET_LAST_DAY_OF_MONTH = ' '
IMPORTING
e_date = i_bday
E_FLG_END_OF_MONTH =
E_DAYS_OF_I_DATE =
added by JAYSHREE 01.02.2007
CONCATENATE i_bday6(2) i_bday4(2) i_bday+2(2)
INTO vbday SEPARATED BY '.'.
i_day = it_bseg-augdt - i_bday.
CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
EXPORTING
date1 = it_bseg-zfbdt
date2 = it_bseg-augdt
OUTPUT_FORMAT = '01'
IMPORTING
YEARS =
MONTHS =
DAYS = i_day
EXCEPTIONS
INVALID_DATES_SPECIFIED = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*added by sunil 5.11.07 ***********
*read table it_intitit with key BELNR_TO = BSEG-BELNR .
*LOOP AT IT_INTITIT.
rf140-element = '521'.
CALL FUNCTION 'write_form'
EXPORTING
window = 'main'
element = '521'
EXCEPTIONS
window = 1
element = 2.
IF sy-subrc = 1.
window = 'main'.
PERFORM message_window.
ENDIF.
IF sy-subrc = 2.
window = 'main'.
ereignis = '521'.
PERFORM message_element.
ENDIF.
IF save_xumstn IS INITIAL.
*-------Umsatzsteuer -
IF xactiv IS INITIAL.
save_waers = rf140-waers.
PERFORM tax_data.
CLEAR taxlines.
DESCRIBE TABLE atax LINES taxlines.
IF NOT taxlines IS INITIAL.
LOOP AT atax.
CLEAR ereignis.
CLEAR rf140-msatz.
CLEAR rf140-vtext.
rf140-msatz = atax-msatz.
*rf140-msatz = atax-msatz.
rf140-vtext = atax-vtext.
*rf140-vtext = atax-vtext.
*******begin of change by karthikeyan on 10.03.06*********************
IF sy-tabix = '1'.
ereignis = '522'.
v_stax = rf140-msatz * rf140-gsaldf / 100.
ELSE.
ereignis = '523'.
v_ecs = rf140-msatz * v_stax / 100.
v_total = rf140-gsaldf + v_stax + v_ecs.
ENDIF.
CALL FUNCTION 'hr_in_chg_inr_wrds'
EXPORTING
amt_in_num = v_total
IMPORTING
amt_in_words = v_spell
EXCEPTIONS
DATA_TYPE_MISMATCH = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
***************************end of change******************************
CLEAR rf140-element.
rf140-element = ereignis.
IF NOT ereignis IS INITIAL.
CALL FUNCTION 'write_form'
EXPORTING
window = 'main'
element = ereignis
EXCEPTIONS
window = 1
element = 2.
IF sy-subrc = 1.
window = 'main'.
PERFORM message_window.
ENDIF.
IF sy-subrc = 2.
window = 'main'.
PERFORM message_element.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
ENDLOOP.
'521' is the element name in the main window where i should display the values. before select qurey the values are coming in the bseg but not in table INTITIT. Belnr is the document no with ref to that
there are number of invoices nos. so in both the tables it is selecting single value and displaying but in bseg the invoice number is getting refreshed and new number is coming in that place i.e in field bseg-rebzg but in INTITIT in belnr only it is taking single value it is not getting refreshed.
move-corresponding hbseg to bseg.
*bseg = bseg.
if bkpf-waers ne *bkpf-waers.
this is the syntax whr the values in bseg are getting refresh and new invoice number is selecting.
How to write the syntax for INTITIT? As per invoice number it is giving new values.
The invoice number in Bseg is different campare to in table INTITIT. in output is shoud show the fields as follows
it_besg-rebzg(invoice number of besg) it_besg-zuonr(invoice date) INTITIT-INT_BASAMT(base amount) i_day (no of days ) INTITIT-INT_BEGIN (INTREST START DATE) INTITIT-INT_end(INTREST END DATE) rf140-wrshb(INTREST AMOUNT).
THE VALUE OF IT_BESG-REBZG IS CHANGING BUT THE VALUE IN INTITIT-BELNR ( INVOICE NUMBER) IS NOT CHANGING THAT IS WHY IT IS SHOWING
ONLY SINGLE RECORD.
for both the table documet no is same. in besg-belnr is the document no. in intitit-BELNR_TO is the document no.
here in bseg-rebzg is chaning but in INTITIT-BELNR IS not changing.
If i take loop at INTITIT. ALL the values are repating so i am unable to take loop. so i want to write
a syntax such that intitit-belnr should be refreshed and also for every loop it shoud take new invoice no.
Please help me out it is very urgent.
<b>USEFUL ANSWERS WILL BE REWARDED.</b>
regards,
Sunil kumar.assumption: some mistake in ur posting that, How belnr and date r same for both header records, so i guess, either one is different.
try with AT NEW - ENDAT.
AT NEW belnr.
here use looping, READing of ur itabs.---> so, u need to build couple of itabs to move forth and back.
ENDAT.
pls. note that, when u use this AT NEW all the CHAR fileds of itab wuld show as STARS **.....so, this is the necessity behind building new itabs.
thanq
Edited by: SAP ABAPer on Dec 30, 2008 6:24 PM -
Problem in Printing the values in SAP Script
Hi,
I have to print the material, description, quantity and value in the invoice.. the problem i face is.. the variables which is of size 40 characters. only prints the data and gets trimmed because of which the data displayed in the invoice not in order.
can any one tell me how to find the length of the variable or is there any way to protect the variable from getting trimmed.
Advance Thanks..
Guhapriyan SHi again,
1. what problem are u facing ?
(there is no sapscript symbol / system symbol
for finding out the length )
(In abap u can use strlen)
2. data and gets trimmed
what is the meaning of it ?
3. do u mean to say that !
ABCDEF 123 45
GEF 123 45
is getting pritned like
ABCDEF 123 45 ?
GEF 123 45
4. If so , then use TABS
5. This happens because SPACE
is different in different varlues of
ABCDEF and GEF !
regards,
amit m.
Message was edited by: Amit Mittal
Maybe you are looking for
-
Unable to cancel Billing due to cleared accounting document for Free Goods
Hi, I have a case as described below: I. SALES ORDER CREATION Transaction VA01 à Sales order is created for the following details: 1. Material Normal (TAN) : 100 CAR 2. Free Goods (TANN) : 10 CAR II. S
-
Mid-2010 Macbook pro repeated crashes after service, HELP!
I have a mid-2010 Macbook pro with the i7 and 8gb of crucial ram. I have had this problem for months and finally took it into the authorized Mac repair center where I live. The nearest apple store is 4 hours away. He put it through 3 days of testing
-
[SOLVED] I have to use "startx" twice in order to make it work
Hello 2 days ago I decided to reinstall Arch Linux again because 3 months ago when I installed Windows, it got installed on top of my Arch partitions (even though I told it to install on my second hard drive). Anyway, I'm having some problems with "s
-
How do I install 10.9.1 without 10.9
I have had to reinstall OSX from the discs that came with my MacBook Pro, which are 10.6. I then restored my backups from time machine and now need to upgrade to 10.9 so everything will run. However Mavericks is now at 10.9.1 and will not install wit
-
OK...here's my system config: MacBook Pro, 17" (MacBookPro2,1), OS X 10.4.10 (8R2232). So running the latest version of Mail. Please note that my Jabber account in iChat is exibiting this exact behavior. Basically, every time I start mail, it asks me